[fpc-pascal] Floating point question

Jonas Maebe jonas at freepascal.org
Thu Feb 8 22:29:05 CET 2024


On 05/02/2024 01:31, James Richters via fpc-pascal wrote:
> So I need to do this?
> AA = Extended(8427+Extended(33/Extended(1440.0)));

Just typecasting 1440.0 to extended should be enough.

> This is inconsistent,  why didn't the 1440.1 version reduce to a single?

Because 1440.1 cannot be represented exactly as a single precision 
floating point number. Nor as a double or extended precision floating 
point number for that matter, and in that case the compiler uses the 
maximum precision is supported by the target platform.



Jonas


More information about the fpc-pascal mailing list