[fpc-pascal] Loss of precision when using math.Max()

Florian Klämpfl florian at freepascal.org
Tue Jul 3 21:55:49 CEST 2018


Am 03.07.2018 um 21:43 schrieb gtt at wolfgang-ehrhardt.de:
> 
> Zitat von Florian Klämpfl <florian at freepascal.org>:
> 
>>
>> So you want float constants being evaluated always with full precision (which would be required for consistency) 
>> causing any floating point expression containing a constant being evaluated with full precision as well?
> 
> Yes, at least as default or selectable per option (like FASTMATH etc),
> and AFAIK it is default for all compilers I know except 3.1.1.

I am not sure if people like this, this means for example that

single2:=single1/3.0;

results in two type conversions and a double division (which is more expensive than a single one). But actually, I just 
found out that we have something like this already for years:

{$minfpconstprec 64}



More information about the fpc-pascal mailing list