We have verified that this is a bug and are working to get a patched
compiler out in the next few days.  Check the web site (address below) for
the update.  In the meantime, you can work around this by using temporaries.
This is only a problem when dividing floating point constants.

double a = 10000.0;
double b = 207.0;
double dTemp = a/b;

http://208.226.102.11/updates.qry

We apologize for the inconvenience.

-E

> -----Original Message-----
> From: Richard Wagner [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 12, 1999 4:58 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Serious brand-new FP bug in CW 5.1
>
>
> This code:
>       double dTemp;
>       dTemp = 10000.0/207.0;
>
> actually assigns the value of .0207 to dTemp.  What's wrong with
> that?  Well
> look again, the stupid compiler REVERSED the operator order!  Instead of
> dividing 10000 by 207 it divided 207 by 10000!
>
> This is 100% reproducable for me in multiple projects using both
> the PalmOS
> FP library and the linkable library (which shouldn't make a difference
> anyway).  This has only been tried under CW 5.1 for Windows. Same stuff
> worked great under CW 5.0 for Windows.  I've also tried no
> optimizations as
> well as maximum optimizations, no difference.
>
> And in case you're curious in Codewarrior (207.0/10000.0) = 48.x!
>
> I haven't played around to see if this applies to anything other than
> doubles since CW 5.1 has already wasted an entire day debugging.
> Grrrr....
>
>
>

Reply via email to