Torsten Dreyer wrote:

>There seems to be a float/rounding issue somewhere in the property system. I 
>noticed this too, when modeling the Seneca. I did some debugging and found 
>that some values - probably 911.00 is one of these - are converted to a float 
>of 910.999999999999999999999 so the display shows 910.99. Same with 700 
>(shows 699.99) 710 (shows 709.99) etc.
>
>  
>
Hmm - that's interesting. If the value had been stored as a float (or 
double) and printed with (say) %6.2f it should have been rounded off 
correctly. I suspect therefore that the radio display code has converted 
this value to an integer in 10Hz steps and failed to do its own rounding.

So it's doing something like "intfreq = (int)real_kHz * 100;" or 
"intfreq = (int)(real_kHz * 100.0);"

If real_kHz had been 910.999999 as suggested, this would give 91099 as 
"intfreq" and yield the reported effect.

What *should* have been done would be more like "intfreq = 
(int)(real_kHz + 0.005) * 100;"

>You can work around this issue by entering 911.001. But I think this is a bug 
>that should be fixed. I try to look into this again in the next week.
>
>Torsten
>  
>

Hopefully, there's a clue or two above! I'd look for it myself, but 
don't have a set of sources on this machine.
Steve.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to