From 65f75791ea4ba661e460a65769b01fc9d6ee7d2b Mon Sep 17 00:00:00 2001 From: sergei <gorelkin@nanoreflex.ru> Date: Mon, 21 Apr 2014 18:32:17 +0000 Subject: [PATCH] * 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 - --- rtl/inc/genmath.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rtl/inc/genmath.inc b/rtl/inc/genmath.inc index 08d7a33f5b..0565f000c1 100644 --- a/rtl/inc/genmath.inc +++ b/rtl/inc/genmath.inc @@ -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;