Re: [fpc-devel] Different computation precision in 32-bit and 64-bit app

2021-07-30 Thread Sven Barth via fpc-devel
NetSpirit via fpc-devel schrieb am Fr., 30. Juli 2021, 15:37: > This code gives distinct results when compiled for Win32 and Win64 > - Win32: 49744125 > - Win64: 49744124.999 > > procedure Test; > var > D: Double; > begin > D := 3 * (exp(3 * ln(255))); > WriteLn('Result: ' +

[fpc-devel] Different computation precision in 32-bit and 64-bit app

2021-07-30 Thread NetSpirit via fpc-devel
This code gives distinct results when compiled for Win32 and Win64 - Win32: 49744125 - Win64: 49744124.999 procedure Test; var D: Double; begin D := 3 * (exp(3 * ln(255))); WriteLn('Result: ' + FloatToStr(D)); end; Somewhere is precision loss (or extra rounding). Is this good?