[Lazarus] Problem with fpc-3.0.4 and double

Marco van de Voort marcov at stack.nl
Fri Feb 2 16:10:17 CET 2018


On Wed, Jan 31, 2018 at 07:31:56PM +0100, zeljko via Lazarus wrote:
> > Using binary floats, there are just too many values that can't be 
> > represented 100%, regardless of the length of the mantissa.
> > https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems
> 
> Thanks Ralf, I know what is floating point arithmetic, but something is 
> changed between 3.0.2 and 3.0.4 and I want to know what it is.

It could be as simple as slightly different codegeneration that eliminates a
temporary variable or adds it. 

The x87 CPU calculates with 80-bits, but storing it into a double variable
(e.g.  a local variable on the stack) will round it to 64-bit double. This
can cause small precision fluctuations, and, as with all regular float
comparison issues, it is something of all times and all compilers.


More information about the Lazarus mailing list