[Haskell-cafe] How to round off frational number?
J. Garrett Morris
trevion at gmail.com
Fri Sep 8 21:38:51 EDT 2006
I've always used:
roundn n f = fromIntegral (round (f * 10 ^ n)) / 10 ^ n
I may have missed some bugs or subtleties of floating point numbers, though.
On 9/8/06, Sara Kenedy <sarakenedy at gmail.com> wrote:
> Hello all,
> I try to find some functions in Haskell library to deal with numeric
> such that the result in the following format (but I did not find)
> For example,
> It seems a so "baby" question, but I really did not find the answer
> after trying on that for some hours.
> Thanks for any help.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
It is myself I have never met, whose face is pasted on the underside of my mind.
More information about the Haskell-Cafe