math.functions: fix memory protection error if exp called on a complex number with a rational real part (reported by prunedtree)

db4
Slava Pestov 2010-01-15 08:23:48 +13:00
parent e8378b3dc6
commit df40d92216
2 changed files with 5 additions and 2 deletions

View File

@ -70,4 +70,7 @@ IN: math.complex.tests
[ ] [ C{ 1 4 } coth drop ] unit-test
[ ] [ C{ 1 4 } cot drop ] unit-test
[ t ] [ 0.0 pi rect> exp C{ -1 0 } 1.0e-7 ~ ] unit-test
[ t ] [ 0 pi rect> exp C{ -1 0 } 1.0e-7 ~ ] unit-test
[ "C{ 1/2 2/3 }" ] [ C{ 1/2 2/3 } unparse ] unit-test

View File

@ -1,4 +1,4 @@
! Copyright (C) 2004, 2008 Slava Pestov.
! Copyright (C) 2004, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: math kernel math.constants math.private math.bits
math.libm combinators math.order sequences ;
@ -62,7 +62,7 @@ M: float exp fexp ; inline
M: real exp >float exp ; inline
M: complex exp >rect swap fexp swap polar> ; inline
M: complex exp >rect swap exp swap polar> ; inline
<PRIVATE