[fpc-devel] rounding precision error with integer and floating point division

Florian Klaempfl florian at freepascal.org
Fri Nov 18 08:46:30 CET 2011


Am 17.11.2011 20:51, schrieb Seth Grover:
> 
> Although I can avoid the problem by casting the longword to a double

How should the compiler know that the division should be done using
double? Using always double slows down calculations. Because the range
of longword fits into a single as well as 24, fpc uses a single division.

> point before the division, this seems like it should be done
> automatically to make results across architectures consistent. 

This is not possible. Especially i386/x87 behaves really strange because
it does calculations always with extended.



More information about the fpc-devel mailing list