[fpc-pascal] Floating point question

Florian Klämpfl florian at freepascal.org
Sun Feb 11 17:31:01 CET 2024


On 09.02.24 15:00, greim--- via fpc-pascal wrote:
> Hi,
> 
> my test with Borland Pascal 7.0 running in dosemu2 running 80x87 code.
> The compiler throws an error message for calculating HH and II with 
> explicit type conversion.
> The results of FF and GG are the same!
> Even on 16 bit system!
> 
> I think this behavior is right!

The x87 fpu behavior is completely flawed as its precision is not 
dependent on the instruction used but the state of the fpu.

Overall, the intermediate float precision is a very difficult topic. The 
famous Goldberg article 
(https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html) does 
not suggest to use the highest possible precision after all. And an 
additional interesting read: 
https://randomascii.wordpress.com/2012/03/21/intermediate-floating-point-precision/



More information about the fpc-pascal mailing list