Write/Writeln/writestring do not round 'correctly' - in contrast to TP6/TP7/Deplhi7
Original Reporter info from Mantis: Kritikon
-
Reporter name: Dr Nafz
Original Reporter info from Mantis: Kritikon
- Reporter name: Dr Nafz
Description:
Write/Writeln round according to DIN1333 in the Borland products TP6/TP7/DP7 that means: If the decimal which will be dropped is <5 then a rounding towards zero will be done otherwise it will be rounded to infinity (or minus infinity in case of negative values). Fpc2.2.4..fpc2.6.2 Win32-Version roundig doesn't follow any mathematical rules: It's neither 'bankers rounding' nor according to DIN1333.
Steps to reproduce:
writeln(6.45:10:1)
-> should print '6.5' (as it does in Turbo/BorlandPascal and Delphi7) but doesn't (this is also true for 7.45, 8.45..) Only 1.45, 2.45 are rounded to 1.5, 2.5. The error is also present in writestring and write.
Mantis conversion info:
- Mantis ID: 24374
- OS: Win32
- OS Build: WinXP SP3
- Platform: Intel /AMD 386
- Version: 2.6.2