Re: [fpc-pascal] Why the difference in the rounded results?

2021-10-15 Thread Guillermo via fpc-pascal
Hi, Silly question: Were all compiled an executed in the same computer and operating system? Also, were all compilations done with same optimization configuration? It is well known that different CPUs have differences in some operations, specially DIV ones that even introduced bugs in the past

Re: [fpc-pascal] Why the difference in the rounded results?

2021-10-15 Thread Ched via fpc-pascal
Hello All, In https://wiki.freepascal.org/Variables_and_Data_Types about Strings: // where: 1 < length <= 255 is to read as // where: 1 <= length <= 255 isn't it ? Cheers, Ched Le 15.10.21 à 18:44, James Richters via fpc-pascal a écrit : The difference is because of the way floating point

Re: [fpc-pascal] Why the difference in the rounded results?

2021-10-15 Thread James Richters via fpc-pascal
The difference is because of the way floating point math works.. and how rounding works. Rounding something that ends with 5 is ambiguous, because it could round up, or it could round down... You can control the behavior of rounding with SetRoundMode(); See