numbers-3000.2.0.0: Various number types

Safe HaskellNone

Data.Number.Fixed

Description

Numbers with a fixed number of decimals.

Synopsis

Documentation

data Fixed e Source

Instances

Enum (Fixed e) 
Eq (Fixed e) 
Epsilon e => Floating (Fixed e) 
Epsilon e => Fractional (Fixed e) 
Epsilon e => Num (Fixed e) 
Ord (Fixed e) 
Epsilon e => Read (Fixed e) 
Epsilon e => Real (Fixed e) 
Epsilon e => RealFloat (Fixed e) 
Epsilon e => RealFrac (Fixed e) 
Epsilon e => Show (Fixed e) 

class Epsilon e Source

The Epsilon class contains the types that can be used to determine the precision of a Fixed number.

data Eps1 Source

An epsilon of 1, i.e., no decimals.

Instances

data EpsDiv10 p Source

A type construct that gives one more decimals than the argument.

Instances

data Prec10 Source

Ten decimals.

Instances

data Prec50 Source

50 decimals.

Instances

data PrecPlus20 e Source

Instances

convertFixed :: (Epsilon e, Epsilon f) => Fixed e -> Fixed fSource

Convert between two arbitrary fixed precision types.

dynamicEps :: forall a. Rational -> (forall e. Epsilon e => Fixed e -> a) -> Rational -> aSource

with_added_precision :: forall a f. Epsilon f => Rational -> (forall e. Epsilon e => Fixed e -> a) -> Fixed f -> aSource

The call with_added_precision r f v evaluates f v, while temporarily multiplying the precision of v by r.