mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-07 11:25:58 +02:00
* correctly compare floating point values in TValue
git-svn-id: trunk@41535 -
This commit is contained in:
parent
2b9c7c7c78
commit
c2da9abd17
@ -37,7 +37,7 @@ function GetArray(const aArg: array of SizeInt): TValue;
|
||||
implementation
|
||||
|
||||
uses
|
||||
TypInfo, SysUtils;
|
||||
TypInfo, SysUtils, Math;
|
||||
|
||||
{$ifndef fpc}
|
||||
function TValueHelper.AsUnicodeString: UnicodeString;
|
||||
@ -124,10 +124,12 @@ begin
|
||||
Result := False
|
||||
else begin
|
||||
case td1^.FloatType of
|
||||
ftSingle,
|
||||
ftDouble,
|
||||
ftSingle:
|
||||
Result := SameValue(Single(aValue1.AsExtended), Single(aValue2.AsExtended));
|
||||
ftDouble:
|
||||
Result := SameValue(Double(aValue1.AsExtended), Double(aValue2.AsExtended));
|
||||
ftExtended:
|
||||
Result := aValue1.AsExtended = aValue2.AsExtended;
|
||||
Result := SameValue(aValue1.AsExtended, aValue2.AsExtended);
|
||||
ftComp:
|
||||
Result := aValue1.AsInt64 = aValue2.AsInt64;
|
||||
ftCurr:
|
||||
|
Loading…
Reference in New Issue
Block a user