|
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.
Parameter types E6 and E12 (for 10^6 and 10^12) are defined, as well as
type synonyms for Fixed E6 and Fixed E12.
This module also contains generalisations of div, mod, and divmod to work
with any Real instance.
|
|
Synopsis |
|
|
|
Documentation |
|
div' :: (Real a, Integral b) => a -> a -> b |
generalisation of div to any instance of Real
|
|
mod' :: Real a => a -> a -> a |
generalisation of mod to any instance of Real
|
|
divMod' :: (Real a, Integral b) => a -> a -> (b, a) |
generalisation of divMod to any instance of Real
|
|
data Fixed a |
Instances | |
|
|
class HasResolution a where |
| Methods | | | Instances | |
|
|
showFixed :: HasResolution a => Bool -> Fixed a -> String |
First arg is whether to chop off trailing zeros
|
|
data E6 |
Instances | |
|
|
type Micro = Fixed E6 |
|
data E12 |
Instances | |
|
|
type Pico = Fixed E12 |
|
Produced by Haddock version 0.8 |