[fpc-pascal] Floating point question

Adriaan van Os adriaan at adriaan.biz
Sun Feb 4 14:33:51 CET 2024


Jonas Maebe via fpc-pascal wrote:
> On 04/02/2024 13:50, Adriaan van Os via fpc-pascal wrote:
>> Jonas Maebe via fpc-pascal wrote:
>>> On 03/02/2024 18:42, James Richters via fpc-pascal wrote:
>>>> Constants are also evaluated wrong,you don’t know what that constant 
>>>> is going to be used for, so all steps of evaluating a constant MUST 
>>>> be done in extended by the compiler, or the answer is just wrong.
>>>
>>> See 
>>> https://wiki.freepascal.org/User_Changes_2.2.0#Floating_point_constants 
>>> and https://www.freepascal.org/daily/doc/prog/progsu19.html
>>
>> I think this discussion shows that the 2.2 compiler change was a bad 
>> idea (for modes other than Delphi).
> 
> This is not just about Delphi. It's also about being able to perform 
> floating point calculations efficiently and getting rid of useless 
> warnings.

But not at the price of loss in precision ! Unless an explicit compiler switch like --fast-math is 
passed <ttps://simonbyrne.github.io/notes/fastmath/> but then it is the resposibility of the 
programmer, not of the compiler.

Regards,

Adriaan van Os


More information about the fpc-pascal mailing list