[fpc-pascal] round(2.5)=2

Jonas Maebe jonas at freepascal.org
Tue Jun 12 23:24:17 CEST 2018


On 12/06/18 23:12, Klaus Hartnegg wrote:
> This behaviour does have advantages in the special case of adding up 
> many rounded numbers, but it ruins the graphics output of my software. 
> It should at least be configurable. And in {$mode tp} it should behave 
> like Turbo Pascal, because that's what this mode is made for.

The basic issue is that FPC doesn't support the 6 byte real type used by 
TP in {$n-}, nor the associated behaviours such as rounding, 
range/precision cut-offs etc. FPC indeed can only support TP {$n+} mode 
compatibility at this time (and even that is not always exact, as it 
depends on the FPU precision support by the hardware and OS).


Jonas



More information about the fpc-pascal mailing list