[Lazarus] Bug in FPC 3.0 discovered

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Fri Mar 11 14:14:26 CET 2016

LacaK wrote:
> Hello,
> this is notification for users, who plan upgrade to latest Lazarus 1.6 
> with FPC 3.0 from older versions which came with FPC 2.6.x
> There was discovered bug in FPC 3.0 (already fixed in trunk) when 
> currency and double data types are involved in mathematical operations 
> like addition or multiplication.
> Bug can be reproduced using simple example:
> var
>  c: currency;
>  d: double;
> begin
>   c:=123.45;
>   d:=100;
>   writeln(c*d);  // wrong result 123450000 instead of 12345
> end.
> Bug does not affects all platforms . For example Win32, Linux64 are not 
> affected. But Win64 IS affected.
> This bug can cause unpredictable misbehavior.
> For example in database applications using fcl-db/sqlDB and NUMERIC or 
> DECIMAL data types as described in bug report #29760

Nota bene (Koenraad, Bo): *Does* affect Raspberry Pi.

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the Lazarus mailing list