[fpc-pascal] Floating point question

James Richters james.richters at productionautomation.net
Fri Feb 9 14:04:44 CET 2024


>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.

I see that now, I think someone pointed out that 1440.5 would also be a
problem since it fits in a single.

So my idea of trying to change all the x.0s to x only helps some cases, not
all cases, as I can't change x.5 to anything quickly with a global search.
There could be anything that happens to fit in a single, making my Extended
calculation come out to a Single.

How does one get the old behavior for programs that use Extended without
analyzing and re-writing thousands of lines of code?

Is there any way we can please get -CF80 or {$MINFPCONSTPREC 80} or some
other way to turn off the new behavior for applications that use Extended.

James



More information about the fpc-pascal mailing list