numbers-3000.2.0.1: Various number types

Safe HaskellNone
LanguageHaskell98

Data.Number.BigFloat

Description

A simple implementation of floating point numbers with a selectable precision. The number of digits in the mantissa is selected by the Epsilon type class from the Fixed module.

The numbers are stored in base 10.

Synopsis

Documentation

data BigFloat e #

Floating point number where the precision is determined by the type e.

Instances

Eq (BigFloat e) # 

Methods

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

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

Epsilon e => Floating (BigFloat e) # 
Epsilon e => Fractional (BigFloat e) # 
Epsilon e => Num (BigFloat e) # 
Epsilon e => Ord (BigFloat e) # 

Methods

compare :: BigFloat e -> BigFloat e -> Ordering #

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

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

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

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

max :: BigFloat e -> BigFloat e -> BigFloat e #

min :: BigFloat e -> BigFloat e -> BigFloat e #

Epsilon e => Real (BigFloat e) # 

Methods

toRational :: BigFloat e -> Rational #

Epsilon e => RealFloat (BigFloat e) # 
Epsilon e => RealFrac (BigFloat e) # 

Methods

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

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

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

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

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

Epsilon e => Show (BigFloat e) # 

Methods

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

show :: BigFloat e -> String #

showList :: [BigFloat e] -> ShowS #

class Epsilon e #

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

Minimal complete definition

eps

Instances

Epsilon Prec50 # 

Methods

eps :: Prec50 -> Rational

Epsilon Prec10 # 

Methods

eps :: Prec10 -> Rational

Epsilon Eps1 # 

Methods

eps :: Eps1 -> Rational

Epsilon e => Epsilon (PrecPlus20 e) # 

Methods

eps :: PrecPlus20 e -> Rational

Epsilon e => Epsilon (EpsDiv10 e) # 

Methods

eps :: EpsDiv10 e -> Rational

data Eps1 #

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

Instances

Epsilon Eps1 # 

Methods

eps :: Eps1 -> Rational

data EpsDiv10 p #

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

Instances

Epsilon e => Epsilon (EpsDiv10 e) # 

Methods

eps :: EpsDiv10 e -> Rational

data Prec10 #

Ten decimals.

Instances

data Prec50 #

50 decimals.

Instances

data PrecPlus20 e #

Instances

Epsilon e => Epsilon (PrecPlus20 e) # 

Methods

eps :: PrecPlus20 e -> Rational