* rem_pio2: Return NaN for infinite or NaN arguments, so it is propagated into return values of sin(),cos() and other (not yet existing) callers.

git-svn-id: trunk@27625 -
This commit is contained in:
sergei 2014-04-21 18:32:17 +00:00
parent 01d63b376e
commit 65f75791ea

View File

@ -951,6 +951,12 @@ type
end;
z := abs(x);
e0 := (float64high(z) shr 20)-1046;
if (e0 = ($7ff-1046)) then { z is Inf or NaN }
begin
z := x - x;
result:=0;
exit;
end;
float64sethigh(z,float64high(z) - (e0 shl 20));
tx[0] := trunc(z);
z := (z-tx[0])*two24;