[Haskell-cafe] Problems with square root...
daniel.carrera at zmsl.com
Wed Dec 21 13:06:38 EST 2005
The sqrt function is not doing what I want. This is what I want:
The problem is that sqrt() returns a "Floating" value and round wants a
*Main> round sqrt(2)
No instances for (RealFrac (a -> a), Integral (t -> a1))
arising from use of `round' at <interactive>:1:0-4
add an instance declaration for (RealFrac (a -> a), Integral (t
In the definition of `it': it = round sqrt (2)
I'm trying to figure out how to turn a Float into a RealFrac so I can
pass it to 'round'. Any ideas?
\/_/ I am not over-weight, I am under-tall.
More information about the Haskell-Cafe