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>