Movatterモバイル変換


[0]ホーム

URL:


base-4.4.0.0: Basic libraries

Portabilityportable
Stabilityexperimental
MaintainerAshley 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

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

dataFixed aSource

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

Instances

HasResolutionE12 
HasResolutionE9 
HasResolutionE6 
HasResolutionE3 
HasResolutionE2 
HasResolutionE1 
HasResolutionE0 

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

First arg is whether to chop off trailing zeros

dataE0Source

Instances

TypeableE0 
HasResolutionE0 

typeUni =FixedE0Source

resolution of 1, this works the same as Integer

dataE1Source

Instances

TypeableE1 
HasResolutionE1 

typeDeci =FixedE1Source

resolution of 10^-1 = .1

dataE2Source

Instances

TypeableE2 
HasResolutionE2 

typeCenti =FixedE2Source

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

dataE3Source

Instances

TypeableE3 
HasResolutionE3 

typeMilli =FixedE3Source

resolution of 10^-3 = .001

dataE6Source

Instances

TypeableE6 
HasResolutionE6 

typeMicro =FixedE6Source

resolution of 10^-6 = .000001

dataE9Source

Instances

TypeableE9 
HasResolutionE9 

typeNano =FixedE9Source

resolution of 10^-9 = .000000001

dataE12Source

Instances

TypeableE12 
HasResolutionE12 

typePico =FixedE12Source

resolution of 10^-12 = .000000000001

Produced byHaddock version 2.9.2


[8]ページ先頭

©2009-2025 Movatter.jp