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

Florian Klämpfl florian at freepascal.org
Tue Jul 3 23:10:43 CEST 2018


Am 03.07.2018 um 22:11 schrieb gtt at wolfgang-ehrhardt.de:
> 
> Zitat von Florian Klämpfl <florian at freepascal.org>:
> 
>>  But actually, I just found out that we have something like this already for years:
>>
>> {$minfpconstprec 64}
> 
> OK, then two questions remain: Why does is occur/apply only for (newer?) 3.1.1 versions?

I dug a little bit deeper, the reason is:
https://bugs.freepascal.org/view.php?id=25121

> And why is there no option to select the maximum precision for the target FPU?
> E.g. if extended has 10 bytes (no only an alias for double with 64-bit), it
> should be possible to select {$minfpconstprec 80} or {$minfpconstprec max}.
>

 From the FPC sources:

           { adding support for 80 bit here is tricky, since we can't really }
           { check whether the target cpu+OS actually supports it            }

(comment not by me). I am not sure, if this is still valid, it is >10 years old.



More information about the fpc-pascal mailing list