Hi,
I had an issue with a comparison of two currency values after upgrading from fpc 2.6.4 to 3.0.0. I had a look around but couldn't find anything about it. It could be related to how I'm using Abs() but I thought I'd post it here in case it really is a bug.
Here's my code:
program quicktest;
{$MODE OBJFPC}{$H+}
uses
classes, sysutils, baseunix, crt;
var
a: currency;
b: currency;
begin
a := -6;
b := 9.6;
if b < Abs(a) then
writeln('this is madness!')
else
writeln('sanity prevails.');
// bonus round
writeln(IntToStr(Length('¥')));
writeln(IntToStr(Length('$')));
end.
When I compile that on fpc 2.6.4 it works and sanity prevails. When I compile it on fpc 3.0.0 there is madness. I have 2.6.4 on Raspbian Jessie and 3.0.0 on Raspbian Stretch but when I copy the 2.6.4 executable over to Stretch it works.
Also I noticed that the Yen symbol has a length of 2 while Dollar is only 1. This happens in 2.6.4 and 3.0.0.
Maybe all these are fixed in 3.0.4, I am investigating how to install that now. If not then I'll flip back to the 2.6.4 environment.
thanks.
kris