[fpc-pascal] Strange floating-point result

Jonas Maebe jonas at freepascal.org
Fri Nov 11 14:08:57 CET 2022


On 11/11/2022 11:49, Thomas Kurz via fpc-pascal wrote:
> Why do I have to explicitly cast Integer to Double here?

Because 1.2E6 can be represented exactly by single precision.

You can use -CF64 to force floating point constants to have at least 64 
bits precision. Or you can use {$excessprecision on} to force the 
compiler to evaluate all floating point expressions always using the 
maximum precision supported by the FPU.


Jonas


More information about the fpc-pascal mailing list