TAChart: Optimized floating point compare routine for sorting. Issue #35356, patch by Marcin Wiazowski

git-svn-id: trunk@61252 -
This commit is contained in:
wp 2019-05-20 21:03:24 +00:00
parent adc9225cec
commit 3992921b51

View File

@ -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
if IsNaN(x2) then
Result := 0 Result := 0
else if IsNaN(x1) then else
Result := +1 Result := +1;
else if IsNaN(x2) then end else
if IsNaN(x2) then
Result := -1 Result := -1
else else
Result := CompareValue(x1, x2); Result := CompareValue(x1, x2);