I am trying to do following:
10 ** length xs * x
but I get:
No instance for (Floating Int) arising from a use of `**'
I am trying to do following:
10 ** length xs * x
but I get:
No instance for (Floating Int) arising from a use of `**'
You can use ^
to raise to an integral power. There's no need to convert to float here.
Besides @sepp2k's answer, if you somehow really need to convert from an integer to some other types of Num, use fromIntegral
.
-- # fromIntegral :: (Integral a, Num b) => a -> b
10 ** fromIntegral (length xs) * x