fix float integer^ for denormal results

db4
Joe Groff 2009-11-01 00:43:04 -05:00
parent 60aecace7d
commit fab5cbc6b9
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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>