Dear all,
I am using samevalue function provided with fpc (math unit).
I am using samevalue instead of = in order to avoid problems related to
precision.
If I compare two values:
a:= 5.1005;
b:= 5.1;
if I use = operator I get that the two numbers are different.
Using samevalue
Andrea Mauri wrote on Wed, 30 Sep 2015:
var
a, b: Double;
begin
a:= 5.1005;
b:= 5.1;
if samevalue(a, b) then // I get TRUE - right!
label1.Caption:= 'same value (variable): True'
else
label1.Caption:= 'same value (variable): False';
if samevalue(a,
thanks.
Il 30/09/2015 13:18, Jonas Maebe ha scritto:
PS: please don't cross-post to multiple lists.
my fault.
andrea
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
On 09/30/2015 07:18 AM, Jonas Maebe wrote:
Andrea Mauri wrote on Wed, 30 Sep 2015:
var
a, b: Double;
begin
a:= 5.1005;
b:= 5.1;
if samevalue(a, b) then // I get TRUE - right!
label1.Caption:= 'same value (variable): True'
else
label1.Caption:= 'same
On 29.09.2015 22:47, Michael Van Canneyt wrote:
Let's first see how Ondrej does it.
See the patch attached. A simple demo program is attached as well
(SITest.lpr).
advancedipc.pp: refactoring MsgID -> RequestID and some smaller issues
solved. API hasn't changed.
singleinstance.pp: class