|
Data.Fixed | Portability | portable | Stability | experimental | Maintainer | Ashley Yakeley <ashley@semantic.org> |
|
|
|
Description |
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.
|
|
Synopsis |
|
|
|
Documentation |
|
|
generalisation of div to any instance of Real
|
|
|
generalisation of mod to any instance of Real
|
|
|
generalisation of divMod to any instance of Real
|
|
|
The type parameter should be an instance of HasResolution.
| Instances | |
|
|
class HasResolution a where | Source |
|
| Methods | | | Instances | |
|
|
|
First arg is whether to chop off trailing zeros
|
|
|
Instances | |
|
|
|
resolution of 1, this works the same as Integer
|
|
|
Instances | |
|
|
|
resolution of 10^-1 = .1
|
|
|
Instances | |
|
|
|
resolution of 10^-2 = .01, useful for many monetary currencies
|
|
|
Instances | |
|
|
|
resolution of 10^-3 = .001
|
|
|
Instances | |
|
|
|
resolution of 10^-6 = .000001
|
|
|
Instances | |
|
|
|
resolution of 10^-9 = .000000001
|
|
|
Instances | |
|
|
|
resolution of 10^-12 = .000000000001
|
|
Produced by Haddock version 2.6.0 |