]> gitweb.factorcode.org Git - factor.git/commitdiff
math.functions: fix ^ for complex numbers
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 1 Jun 2009 04:28:29 +0000 (23:28 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 1 Jun 2009 04:28:29 +0000 (23:28 -0500)
basis/math/functions/functions-tests.factor
basis/math/functions/functions.factor

index 66d813bab8c9f919ad31ecde044237ff011dea59..0bdc6ce00bcb560a792d8f8d5c4b58677b08c6e4 100644 (file)
@@ -162,3 +162,4 @@ IN: math.functions.tests
 [ 2.5  ] [ 1.0 2.5 1.0 lerp ] unit-test
 [ 1.75 ] [ 1.0 2.5 0.5 lerp ] unit-test
 
+[ C{ 1 2 } ] [ C{ 1 2 } 1 ^ ] unit-test
\ No newline at end of file
index a1bf9480d50315a0d15991427af3f9fe441b4869..5d88eba9fa778e57edb916ef3a795ade5bdc0524 100644 (file)
@@ -34,8 +34,9 @@ M: integer ^n
 M: ratio ^n
     [ >fraction ] dip [ ^n ] curry bi@ / ;
 
-M: float ^n
-    (^n) ;
+M: float ^n (^n) ;
+
+M: complex ^n (^n) ;
 
 : integer^ ( x y -- z )
     dup 0 > [ ^n ] [ neg ^n recip ] if ; inline