(^) :: (Num a, Integral b) => a -> b -> a. Because Float is not an instance of the Integral type class, you can't use the ^ operator to raise a number to a power whose value is of type Float.
– jub0bs
(**) can be used to take powers of Float exponents....
(^) is only for integral exponents.
2 ^ 2.1 --fails
2 ** 2.1 --works
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
(^) :: (Num a, Integral b) => a -> b -> a
. BecauseFloat
is not an instance of theIntegral
type class, you can't use the^
operator to raise a number to a power whose value is of typeFloat
. – jub0bs