[fpc-pascal] Floating point question

Ern Aldo pasfrelst at dyadic.org
Thu Feb 15 23:03:57 CET 2024


Compile-time math needs to be as correct as possible. RUN-time math can worry 
about performance. The whole point of computer programming is to let the 
machine do the hard work up front.

Regarding optimizations for speed at the expense of mathematical correctness, 
they need to default to Off, and be switchable to ON for compile-time math. 
Runtime math *maybe* could default to On, but since this is a change in 
correctness for program output, it needs to be announced as a much bigger deal 
as far as source-compatibility with existing code.

On 2024-02-13 06:00, fpc-pascal-request at lists.freepascal.org wrote:
the compiler math is ... reducing each term of an expression ... and the answer 
is not coming out right.

this would result in less efficient code, since all the math will then be done 
at full precision, which is slower. it is a trade-off between size (=precision) 
and speed.

[in] compile time math, performance doesn't count
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20240215/82d65429/attachment.htm>


More information about the fpc-pascal mailing list