[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#216616: gcc-3.2: floating point problem with athlon thunderbird



Alban Browaeys <albanbrowaeys@oreka.com> writes:

> Is it ok that double operators give diferents results with athlon TB
> than with other processors ?

No. But of course gcc can do nothing about it if it is the case;
complain to the hardware vendor.

> extract from the real mozilla code (cf bug #203100):
> d, ds are double; L a long
>   L = (Long) (d / ds);
>   d -= L*ds;
>   on athlon  "d - d != 0"  (especially d -= L*ds) though it is on other
>   processors (still same binary)
>   
>   the loop is ended by:
>   if (!(d *= 10.))
>     break;
>   and d never equals 0 

Comparing floating point values with == and != is nearly always a
mistake, especially on x86 where registers have more precision than
stored values, you cannot expect to get anything sensible from it.
Please read http://www.validlab.com/goldberg/paper.ps.

IMHO we should close this bug.

-- 
	Falk



Reply to: