Stefan Heinzmann wrote:

Hi all,

is there a library for Haskell that implements scaled integers, i.e.
integers with a fixed scale factor so that the scale factor does not
need to be stored, but is part of the type?

Data.Fixed [1] does exactly that, only it is based on Integer. Using fixed point with finite sized integers is more tricky, because you have to be careful not to get overflows in intermediate results.

Twan


[1] http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Fixed.html

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to