From fab5cbc6b986060618b7c020a315223df00f37ff Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 1 Nov 2009 00:43:04 -0500 Subject: [PATCH] fix float integer^ for denormal results --- basis/math/functions/functions-tests.factor | 3 +++ basis/math/functions/functions.factor | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/basis/math/functions/functions-tests.factor b/basis/math/functions/functions-tests.factor index 1914bae008..73f08e2665 100644 --- a/basis/math/functions/functions-tests.factor +++ b/basis/math/functions/functions-tests.factor @@ -25,6 +25,9 @@ IN: math.functions.tests [ t ] [ e pi i* ^ real-part -1.0 = ] unit-test [ t ] [ e pi i* ^ imaginary-part -0.00001 0.00001 between? ] unit-test +[ 1/0. ] [ 2.0 1024 ^ ] unit-test +[ HEX: 1.0p-1024 ] [ 2.0 -1024 ^ ] unit-test + [ t ] [ 0 0 ^ fp-nan? ] unit-test [ 0.0 ] [ 0.0 1.0 ^ ] unit-test [ 1/0. ] [ 0 -2 ^ ] unit-test diff --git a/basis/math/functions/functions.factor b/basis/math/functions/functions.factor index 0e0ccd5ecf..d91b4b6b92 100644 --- a/basis/math/functions/functions.factor +++ b/basis/math/functions/functions.factor @@ -39,7 +39,7 @@ M: float ^n (^n) ; M: complex ^n (^n) ; : integer^ ( x y -- z ) - dup 0 > [ ^n ] [ neg ^n recip ] if ; inline + dup 0 >= [ ^n ] [ [ recip ] dip neg ^n ] if ; inline PRIVATE>