RosettaCodeData/Task/Exponentiation-operator/Haskell/exponentiation-operator-2.hs
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

2 lines
104 B
Haskell

(^^) :: (Fractional a, Integral b) => a -> b -> a
x ^^ n = if n >= 0 then x^n else recip (x^(negate n))