| Portability | portable |
|---|---|
| Stability | experimental |
| Maintainer | Ashley Yakeley <ashley@semantic.org> |
Data.Fixed
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
divMod' :: (Real a,Integral b) => a -> a -> (b, a)Source
generalisation ofdivMod to any instance of Real
The type parameter should be an instance ofHasResolution.
Instances
| Typeable1Fixed | |
| Enum (Fixed a) | |
| Eq (Fixed a) | |
| HasResolution a =>Fractional (Fixed a) | |
| Typeable a =>Data (Fixed a) | |
| HasResolution a =>Num (Fixed a) | |
| Ord (Fixed a) | |
| HasResolution a =>Read (Fixed a) | |
| HasResolution a =>Real (Fixed a) | |
| HasResolution a =>RealFrac (Fixed a) | |
| HasResolution a =>Show (Fixed a) |
classHasResolution awhereSource
Methods
resolution :: p a ->IntegerSource
Produced byHaddock version 2.9.2