[Haskell-cafe] round function
achatzianastassiou at hotmail.com
Sun Feb 12 16:00:19 EST 2006
I am trying to implement a function that finds the significant figure of a
number to a specified point i.e. 2.55555 3 = 2.556. I have implemented
sig :: (RealFrac a, Integral b) => a -> Int -> a
sig x y = round y
However this doesn't work. Moreover at the Prelude when i type round 2.3333
2 i get an error.
Dont just search. Find. Check out the new MSN Search!
More information about the Haskell-Cafe