[Haskell-cafe] round function
Chatzianastassiou Achilleas
achatzianastassiou at hotmail.com
Sun Feb 12 16:00:19 EST 2006
Hi all,
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
something like:
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.
Any suggestions?
Thanks,
Skag55
_________________________________________________________________
Dont just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
More information about the Haskell-Cafe
mailing list