Movatterモバイル変換


[0]ホーム

URL:


base-4.12.0.0: Basic libraries

Copyright(c) Ashley Yakeley 2005 2006 2009
LicenseBSD-style (see the file libraries/base/LICENSE)
MaintainerAshley Yakeley <ashley@semantic.org>
Stabilityexperimental
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell2010

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

Documentation

div' :: (Real a,Integral b) => a -> a -> bSource#

generalisation ofdiv to any instance of Real

mod' ::Real a => a -> a -> aSource#

generalisation ofmod to any instance of Real

divMod' :: (Real a,Integral b) => a -> a -> (b, a)Source#

generalisation ofdivMod to any instance of Real

newtypeFixed aSource#

The type parameter should be an instance ofHasResolution.

Constructors

MkFixedInteger 
Instances
Enum (Fixed a)Source#

Since: 2.1

Instance details

Defined inData.Fixed

Eq (Fixed a)Source#

Since: 2.1

Instance details

Defined inData.Fixed

Methods

(==) ::Fixed a ->Fixed a ->Bool#

(/=) ::Fixed a ->Fixed a ->Bool#

HasResolution a =>Fractional (Fixed a)Source#

Since: 2.1

Instance details

Defined inData.Fixed

Typeable a =>Data (Fixed a)Source#

Since: 4.1.0.0

Instance details

Defined inData.Fixed

Methods

gfoldl :: (forall d b.Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) ->Fixed a -> c (Fixed a)Source#

gunfold :: (forall b r.Data b => c (b -> r) -> c r) -> (forall r. r -> c r) ->Constr -> c (Fixed a)Source#

toConstr ::Fixed a ->ConstrSource#

dataTypeOf ::Fixed a ->DataTypeSource#

dataCast1 ::Typeable t => (forall d.Data d => c (t d)) ->Maybe (c (Fixed a))Source#

dataCast2 ::Typeable t => (forall d e. (Data d,Data e) => c (t d e)) ->Maybe (c (Fixed a))Source#

gmapT :: (forall b.Data b => b -> b) ->Fixed a ->Fixed aSource#

gmapQl :: (r -> r' -> r) -> r -> (forall d.Data d => d -> r') ->Fixed a -> rSource#

gmapQr :: (r' -> r -> r) -> r -> (forall d.Data d => d -> r') ->Fixed a -> rSource#

gmapQ :: (forall d.Data d => d -> u) ->Fixed a -> [u]Source#

gmapQi ::Int -> (forall d.Data d => d -> u) ->Fixed a -> uSource#

gmapM ::Monad m => (forall d.Data d => d -> m d) ->Fixed a -> m (Fixed a)Source#

gmapMp ::MonadPlus m => (forall d.Data d => d -> m d) ->Fixed a -> m (Fixed a)Source#

gmapMo ::MonadPlus m => (forall d.Data d => d -> m d) ->Fixed a -> m (Fixed a)Source#

HasResolution a =>Num (Fixed a)Source#

Since: 2.1

Instance details

Defined inData.Fixed

Ord (Fixed a)Source#

Since: 2.1

Instance details

Defined inData.Fixed

Methods

compare ::Fixed a ->Fixed a ->Ordering#

(<) ::Fixed a ->Fixed a ->Bool#

(<=) ::Fixed a ->Fixed a ->Bool#

(>) ::Fixed a ->Fixed a ->Bool#

(>=) ::Fixed a ->Fixed a ->Bool#

max ::Fixed a ->Fixed a ->Fixed a#

min ::Fixed a ->Fixed a ->Fixed a#

HasResolution a =>Read (Fixed a)Source#

Since: 4.3.0.0

Instance details

Defined inData.Fixed

HasResolution a =>Real (Fixed a)Source#

Since: 2.1

Instance details

Defined inData.Fixed

HasResolution a =>RealFrac (Fixed a)Source#

Since: 2.1

Instance details

Defined inData.Fixed

HasResolution a =>Show (Fixed a)Source#

Since: 2.1

Instance details

Defined inData.Fixed

classHasResolution awhereSource#

Methods

resolution :: p a ->IntegerSource#

Instances
HasResolutionE12Source#

Since: 2.1

Instance details

Defined inData.Fixed

HasResolutionE9Source#

Since: 4.1.0.0

Instance details

Defined inData.Fixed

HasResolutionE6Source#

Since: 2.1

Instance details

Defined inData.Fixed

HasResolutionE3Source#

Since: 4.1.0.0

Instance details

Defined inData.Fixed

HasResolutionE2Source#

Since: 4.1.0.0

Instance details

Defined inData.Fixed

HasResolutionE1Source#

Since: 4.1.0.0

Instance details

Defined inData.Fixed

HasResolutionE0Source#

Since: 4.1.0.0

Instance details

Defined inData.Fixed

showFixed ::HasResolution a =>Bool ->Fixed a ->StringSource#

First arg is whether to chop off trailing zeros

dataE0Source#

Instances
HasResolutionE0Source#

Since: 4.1.0.0

Instance details

Defined inData.Fixed

typeUni =FixedE0Source#

resolution of 1, this works the same as Integer

dataE1Source#

Instances
HasResolutionE1Source#

Since: 4.1.0.0

Instance details

Defined inData.Fixed

typeDeci =FixedE1Source#

resolution of 10^-1 = .1

dataE2Source#

Instances
HasResolutionE2Source#

Since: 4.1.0.0

Instance details

Defined inData.Fixed

typeCenti =FixedE2Source#

resolution of 10^-2 = .01, useful for many monetary currencies

dataE3Source#

Instances
HasResolutionE3Source#

Since: 4.1.0.0

Instance details

Defined inData.Fixed

typeMilli =FixedE3Source#

resolution of 10^-3 = .001

dataE6Source#

Instances
HasResolutionE6Source#

Since: 2.1

Instance details

Defined inData.Fixed

typeMicro =FixedE6Source#

resolution of 10^-6 = .000001

dataE9Source#

Instances
HasResolutionE9Source#

Since: 4.1.0.0

Instance details

Defined inData.Fixed

typeNano =FixedE9Source#

resolution of 10^-9 = .000000001

dataE12Source#

Instances
HasResolutionE12Source#

Since: 2.1

Instance details

Defined inData.Fixed

typePico =FixedE12Source#

resolution of 10^-12 = .000000000001

Produced byHaddock version 2.20.0


[8]ページ先頭

©2009-2025 Movatter.jp