I had the same problem. Best answer I got was the Palm OS does not perform
rounding like other OSs. It displays the number sorted in memory, quantized
errors and all. I ended up injecting error into my calculations to offset
this problem. (i.e. I added 0.000001 to some variables in critical
calculations to get the correct results.
D
-----Original Message-----
From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, May 10, 1999 11:34 AM
Subject: Double precision number problem. Why 20.5 SOMETIMES is stored as
20.499999000?
>I am using CW 5.0 without the patch and PalmOS 3.0.
>
>when I compile the following code:
> double var ;
> var=20.5 ;
>
>during the debug, most of the time I see that var=20.4999990000, but
>sometimes the right value (20.5) is stored.
>
>What is causing this mismatch and how to prevent it?
>Is there any document where double float operations on PalmOS would be
>explained?
>
>FYI,
>I use 8-byte double setting of the Compiler
>I am not using NewFloatMgr
>
>
>Marcin Frelek
>
>
>
>