numbers-3000.2.0.2: Various number types

Safe HaskellNone
LanguageHaskell98

Data.Number.Fixed

Description

Numbers with a fixed number of decimals.

Synopsis

Documentation

data Fixed e Source #

Instances

Enum (Fixed e) Source # 

Methods

succ :: Fixed e -> Fixed e #

pred :: Fixed e -> Fixed e #

toEnum :: Int -> Fixed e #

fromEnum :: Fixed e -> Int #

enumFrom :: Fixed e -> [Fixed e] #

enumFromThen :: Fixed e -> Fixed e -> [Fixed e] #

enumFromTo :: Fixed e -> Fixed e -> [Fixed e] #

enumFromThenTo :: Fixed e -> Fixed e -> Fixed e -> [Fixed e] #

Eq (Fixed e) Source # 

Methods

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

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

Epsilon e => Floating (Fixed e) Source # 

Methods

pi :: Fixed e #

exp :: Fixed e -> Fixed e #

log :: Fixed e -> Fixed e #

sqrt :: Fixed e -> Fixed e #

(**) :: Fixed e -> Fixed e -> Fixed e #

logBase :: Fixed e -> Fixed e -> Fixed e #

sin :: Fixed e -> Fixed e #

cos :: Fixed e -> Fixed e #

tan :: Fixed e -> Fixed e #

asin :: Fixed e -> Fixed e #

acos :: Fixed e -> Fixed e #

atan :: Fixed e -> Fixed e #

sinh :: Fixed e -> Fixed e #

cosh :: Fixed e -> Fixed e #

tanh :: Fixed e -> Fixed e #

asinh :: Fixed e -> Fixed e #

acosh :: Fixed e -> Fixed e #

atanh :: Fixed e -> Fixed e #

log1p :: Fixed e -> Fixed e #

expm1 :: Fixed e -> Fixed e #

log1pexp :: Fixed e -> Fixed e #

log1mexp :: Fixed e -> Fixed e #

Epsilon e => Fractional (Fixed e) Source # 

Methods

(/) :: Fixed e -> Fixed e -> Fixed e #

recip :: Fixed e -> Fixed e #

fromRational :: Rational -> Fixed e #

Epsilon e => Num (Fixed e) Source # 

Methods

(+) :: Fixed e -> Fixed e -> Fixed e #

(-) :: Fixed e -> Fixed e -> Fixed e #

(*) :: Fixed e -> Fixed e -> Fixed e #

negate :: Fixed e -> Fixed e #

abs :: Fixed e -> Fixed e #

signum :: Fixed e -> Fixed e #

fromInteger :: Integer -> Fixed e #

Ord (Fixed e) Source # 

Methods

compare :: Fixed e -> Fixed e -> Ordering #

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

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

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

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

max :: Fixed e -> Fixed e -> Fixed e #

min :: Fixed e -> Fixed e -> Fixed e #

Epsilon e => Read (Fixed e) Source # 
Epsilon e => Real (Fixed e) Source # 

Methods

toRational :: Fixed e -> Rational #

Epsilon e => RealFloat (Fixed e) Source # 
Epsilon e => RealFrac (Fixed e) Source # 

Methods

properFraction :: Integral b => Fixed e -> (b, Fixed e) #

truncate :: Integral b => Fixed e -> b #

round :: Integral b => Fixed e -> b #

ceiling :: Integral b => Fixed e -> b #

floor :: Integral b => Fixed e -> b #

Epsilon e => Show (Fixed e) Source # 

Methods

showsPrec :: Int -> Fixed e -> ShowS #

show :: Fixed e -> String #

showList :: [Fixed e] -> ShowS #

class Epsilon e Source #

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

Minimal complete definition

eps

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

Epsilon e => Epsilon (EpsDiv10 e) Source # 

Methods

eps :: EpsDiv10 e -> Rational

data Prec10 Source #

Ten decimals.

Instances

data Prec50 Source #

50 decimals.

Instances

data PrecPlus20 e Source #

Instances

data Prec500 Source #

500 decimals.

Instances

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

Convert between two arbitrary fixed precision types.

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

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

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