[Haskell-cafe] about integer and float operations

Thomas DuBuisson thomas.dubuisson at gmail.com
Wed Feb 4 16:42:56 EST 2009


> No.
> I'm looking for an exact integer division that avoids overflows, if
> possible.

Use Data.Ratio:

*Main Data.Ratio>  (fac 777) / (4 * fac 776) :: Ratio Integer
777%4

Convert to a float , if you want, before displaying it.


More information about the Haskell-Cafe mailing list