mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-25 20:28:15 +02:00
TAChart: Optimized floating point compare routine for sorting. Issue #35356, patch by Marcin Wiazowski
git-svn-id: trunk@61252 -
This commit is contained in:
parent
adc9225cec
commit
3992921b51
@ -1613,11 +1613,13 @@ end;
|
|||||||
|
|
||||||
function CompareFloat(const x1, x2: Double): Integer;
|
function CompareFloat(const x1, x2: Double): Integer;
|
||||||
begin
|
begin
|
||||||
if IsNaN(x1) and IsNaN(x2) then
|
if IsNaN(x1) then begin
|
||||||
Result := 0
|
if IsNaN(x2) then
|
||||||
else if IsNaN(x1) then
|
Result := 0
|
||||||
Result := +1
|
else
|
||||||
else if IsNaN(x2) then
|
Result := +1;
|
||||||
|
end else
|
||||||
|
if IsNaN(x2) then
|
||||||
Result := -1
|
Result := -1
|
||||||
else
|
else
|
||||||
Result := CompareValue(x1, x2);
|
Result := CompareValue(x1, x2);
|
||||||
|
Loading…
Reference in New Issue
Block a user