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