Hey,

The sqrt function is not doing what I want. This is what I want:

round sqrt(2)

The problem is that sqrt() returns a "Floating" value and round wants a "ReacFrac":
--//--
*Main> round sqrt(2)
<interactive>:1:0:
    No instances for (RealFrac (a -> a), Integral (t -> a1))
      arising from use of `round' at <interactive>:1:0-4
    Probable fix:
add an instance declaration for (RealFrac (a -> a), Integral (t -> a1))
    In the definition of `it': it = round sqrt (2)
*Main>
--//--

I'm trying to figure out how to turn a Float into a RealFrac so I can pass it to 'round'. Any ideas?

Daniel.
--
     /\/`) http://oooauthors.org
    /\/_/  http://opendocumentfellowship.org
   /\/_/
   \/_/    I am not over-weight, I am under-tall.
   /
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to