[fpc-pascal] Floating point question

Thomas Kurz fpc.2021 at t-net.ruhr
Thu Feb 22 15:38:58 CET 2024


> For constants, the compiler will choose a type and consequently the precision. 
> Jonas and others have explained the rules that the compiler uses.
>
> If you don't like the rules that the compiler uses, you can set a type for your
> constants. When you explicitly set a type, you are also specifying the precision of the > calculation.

If the ruleset won't change - and from what I've read from the developers, it won't change - could we please have the compiler issue a warning (or a hint) if a loss in precision happens.

E.g. "Warning: constant reduced to single precision. Use {$MINFPCONSTPREC} or Double() to keep full precision."

I am aware about this behavior now, but nevertheless I'd like to get warned if I forget about either of those.



More information about the fpc-pascal mailing list