> It's an issue with the finite precision of floating point variables. 
> Everyone is suprised when first seeing this. Only values which happen to 
> be a sum of "binary fractions" (e.g. 1/2 + 1/4 + 1/8) can be represented 
> accurately. Everything else, even simple _decimal_ values such as "0.1" 
> or "0.775" cannot be represented exactly in _binary_. Usually this 
> doesn't matter, since when you print a value to screen - or to a string 
> buffer, you'll limit the precision. Something like 0.7749998175 will be 
> printed as "0.775" if you limit to 3 digits. Obviously the property 
> browser doesn't limit to 3 digits, but shows more, hence you see a 
> difference.
 
That sounds reasonable to me, I've already read something about that, still I 
don't grab what's going on in this specific case.

I mean, the values that FGFS assigns to the standby-mhz property on its own are 
exactly precise! No trailing decimals after the first three. When not using 
Arduino to feed those data, FGFS doesn't get it wrong, never! 120.3 is exactly 
120.3, just like 131.925 or any other frequency value, they're all exact 
without any other decimal digit. And they're all values assigned by the 3d knob 
property-assign animation statement. That means to me it's possible to store in 
the property tree float ... ooopsss ... double values with an exact decimal 
precision. How do I deal with that? What am I still missing? Why the 
property-assign can do that excatly and a generic protocol can't?


> Also, the properties use double floating points (64bit). You're protocol 
> uses float (32bit) - so you loose some precision, which makes the effect 
> slightly worse.

Well, readme.protocol does not mention a double format, float only; should I 
think double is anyway, just undocumented? I should really study more C++ and 
read the code by myself, damn!!!!
-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!                       
Jetzt informieren: http://www.gmx.net/de/go/freephone

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to