|Copyright||(c) Ashley Yakeley 2005, 2006, 2009|
|License||BSD-style (see the file libraries/base/LICENSE)|
|Maintainer||Ashley Yakeley <[email protected]>|
This module defines a "Fixed" type for fixed-precision arithmetic. The parameter to Fixed is any type that's an instance of HasResolution. HasResolution has a single method that gives the resolution of the Fixed type.
This module also contains generalisations of div, mod, and divmod to work with any Real instance.
div to any instance of Real
mod to any instance of Real
divMod to any instance of Real
The type parameter should be an instance of
First arg is whether to chop off trailing zeros
resolution of 1, this works the same as Integer
resolution of 10^-1 = .1
resolution of 10^-2 = .01, useful for many monetary currencies
resolution of 10^-3 = .001
resolution of 10^-6 = .000001
resolution of 10^-9 = .000000001
resolution of 10^-12 = .000000000001
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).