 GENERIC# ^n 1 ( z w -- z^w ) foldable
 
 : (^n) ( z w -- z^w )
-    make-bits 1 [ [ dupd * ] when [ sq ] dip ] reduce nip ; inline
+    make-bits 1 [ [ over * ] when [ sq ] dip ] reduce nip ; inline
 
 M: integer ^n
     [ factor-2s ] dip [ (^n) ] keep rot * shift ;
 
 M: ratio ^n
-    [ >fraction ] dip [ ^n ] curry bi@ / ;
+    [ >fraction ] dip '[ _ ^n ] bi@ / ;
 
 M: float ^n (^n) ;
 

    [ non-trivial-divisor ] if ; foldable

: ^mod ( x y n -- z )
    over 0 < [
        [ [ neg ] dip ^mod ] keep mod-inv
    ] [
        -rot (^mod)
    ] if ; foldable

GENERIC: absq ( x -- y ) foldable



M: real exp >float exp ; inline

M: complex exp >rect [ exp ] dip polar> ; inline

<PRIVATE

