mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-03 22:44:53 +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;
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user