connections-0.0.3: Partial orders, Galois connections, and lattices.

Safe HaskellNone
LanguageHaskell2010

Data.Float

Synopsis

Documentation

data Float #

Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type.

Instances
Eq Float

Note that due to the presence of NaN, Float's Eq instance does not satisfy reflexivity.

>>> 0/0 == (0/0 :: Float)
False

Also note that Float's Eq instance does not satisfy substitutivity:

>>> 0 == (-0 :: Float)
True
>>> recip 0 == recip (-0 :: Float)
False
Instance details

Defined in GHC.Classes

Methods

(==) :: Float -> Float -> Bool #

(/=) :: Float -> Float -> Bool #

Floating Float

Since: base-2.1

Instance details

Defined in GHC.Float

Ord Float

Note that due to the presence of NaN, Float's Ord instance does not satisfy reflexivity.

>>> 0/0 <= (0/0 :: Float)
False

Also note that, due to the same, Ord's operator interactions are not respected by Float's instance:

>>> (0/0 :: Float) > 1
False
>>> compare (0/0 :: Float) 1
GT
Instance details

Defined in GHC.Classes

Methods

compare :: Float -> Float -> Ordering #

(<) :: Float -> Float -> Bool #

(<=) :: Float -> Float -> Bool #

(>) :: Float -> Float -> Bool #

(>=) :: Float -> Float -> Bool #

max :: Float -> Float -> Float #

min :: Float -> Float -> Float #

Read Float

Since: base-2.1

Instance details

Defined in GHC.Read

RealFloat Float

Since: base-2.1

Instance details

Defined in GHC.Float

Lift Float 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Float -> Q Exp #

Storable Float

Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Float -> Int #

alignment :: Float -> Int #

peekElemOff :: Ptr Float -> Int -> IO Float #

pokeElemOff :: Ptr Float -> Int -> Float -> IO () #

peekByteOff :: Ptr b -> Int -> IO Float #

pokeByteOff :: Ptr b -> Int -> Float -> IO () #

peek :: Ptr Float -> IO Float #

poke :: Ptr Float -> Float -> IO () #

Hashable Float 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Float -> Int #

hash :: Float -> Int #

Semifield Float 
Instance details

Defined in Data.Semifield

Field Float 
Instance details

Defined in Data.Semifield

Real Float 
Instance details

Defined in Data.Semifield

Presemiring Float 
Instance details

Defined in Data.Semiring

Semiring Float 
Instance details

Defined in Data.Semiring

Ring Float 
Instance details

Defined in Data.Semiring

Maximal Float Source # 
Instance details

Defined in Data.Prd

Methods

maximal :: Float Source #

Minimal Float Source # 
Instance details

Defined in Data.Prd

Methods

minimal :: Float Source #

Prd Float Source # 
Instance details

Defined in Data.Prd

TripInt16 Float Source # 
Instance details

Defined in Data.Connection.Round

TripRatio Integer Float Source # 
Instance details

Defined in Data.Connection.Ratio

Generic1 (URec Float :: k -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Float) :: k -> Type #

Methods

from1 :: URec Float a -> Rep1 (URec Float) a #

to1 :: Rep1 (URec Float) a -> URec Float a #

Semigroup (Additive Float) 
Instance details

Defined in Data.Semigroup.Additive

Semigroup (Multiplicative Float) 
Instance details

Defined in Data.Semigroup.Multiplicative

Monoid (Additive Float) 
Instance details

Defined in Data.Semigroup.Additive

Monoid (Multiplicative Float) 
Instance details

Defined in Data.Semigroup.Multiplicative

Group (Additive Float) 
Instance details

Defined in Data.Semigroup.Additive

Group (Multiplicative Float) 
Instance details

Defined in Data.Semigroup.Multiplicative

Loop (Additive Float) 
Instance details

Defined in Data.Semigroup.Additive

Loop (Multiplicative Float) 
Instance details

Defined in Data.Semigroup.Multiplicative

Quasigroup (Additive Float) 
Instance details

Defined in Data.Semigroup.Additive

Quasigroup (Multiplicative Float) 
Instance details

Defined in Data.Semigroup.Multiplicative

Magma (Additive Float) 
Instance details

Defined in Data.Semigroup.Additive

Magma (Multiplicative Float) 
Instance details

Defined in Data.Semigroup.Multiplicative

Functor (URec Float :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Float a -> URec Float b #

(<$) :: a -> URec Float b -> URec Float a #

Foldable (URec Float :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => URec Float m -> m #

foldMap :: Monoid m => (a -> m) -> URec Float a -> m #

foldr :: (a -> b -> b) -> b -> URec Float a -> b #

foldr' :: (a -> b -> b) -> b -> URec Float a -> b #

foldl :: (b -> a -> b) -> b -> URec Float a -> b #

foldl' :: (b -> a -> b) -> b -> URec Float a -> b #

foldr1 :: (a -> a -> a) -> URec Float a -> a #

foldl1 :: (a -> a -> a) -> URec Float a -> a #

toList :: URec Float a -> [a] #

null :: URec Float a -> Bool #

length :: URec Float a -> Int #

elem :: Eq a => a -> URec Float a -> Bool #

maximum :: Ord a => URec Float a -> a #

minimum :: Ord a => URec Float a -> a #

sum :: Num a => URec Float a -> a #

product :: Num a => URec Float a -> a #

Traversable (URec Float :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> URec Float a -> f (URec Float b) #

sequenceA :: Applicative f => URec Float (f a) -> f (URec Float a) #

mapM :: Monad m => (a -> m b) -> URec Float a -> m (URec Float b) #

sequence :: Monad m => URec Float (m a) -> m (URec Float a) #

Eq (URec Float p) 
Instance details

Defined in GHC.Generics

Methods

(==) :: URec Float p -> URec Float p -> Bool #

(/=) :: URec Float p -> URec Float p -> Bool #

Ord (URec Float p) 
Instance details

Defined in GHC.Generics

Methods

compare :: URec Float p -> URec Float p -> Ordering #

(<) :: URec Float p -> URec Float p -> Bool #

(<=) :: URec Float p -> URec Float p -> Bool #

(>) :: URec Float p -> URec Float p -> Bool #

(>=) :: URec Float p -> URec Float p -> Bool #

max :: URec Float p -> URec Float p -> URec Float p #

min :: URec Float p -> URec Float p -> URec Float p #

Show (URec Float p) 
Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Float p -> ShowS #

show :: URec Float p -> String #

showList :: [URec Float p] -> ShowS #

Generic (URec Float p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Float p) :: Type -> Type #

Methods

from :: URec Float p -> Rep (URec Float p) x #

to :: Rep (URec Float p) x -> URec Float p #

data URec Float (p :: k)

Used for marking occurrences of Float#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

data URec Float (p :: k) = UFloat {}
type Rep1 (URec Float :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (URec Float :: k -> Type) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UFloat" PrefixI True) (S1 (MetaSel (Just "uFloat#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UFloat :: k -> Type)))
type Rep (URec Float p) 
Instance details

Defined in GHC.Generics

type Rep (URec Float p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UFloat" PrefixI True) (S1 (MetaSel (Just "uFloat#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UFloat :: Type -> Type)))

data Double #

Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.

Instances
Eq Double

Note that due to the presence of NaN, Double's Eq instance does not satisfy reflexivity.

>>> 0/0 == (0/0 :: Double)
False

Also note that Double's Eq instance does not satisfy substitutivity:

>>> 0 == (-0 :: Double)
True
>>> recip 0 == recip (-0 :: Double)
False
Instance details

Defined in GHC.Classes

Methods

(==) :: Double -> Double -> Bool #

(/=) :: Double -> Double -> Bool #

Floating Double

Since: base-2.1

Instance details

Defined in GHC.Float

Ord Double

Note that due to the presence of NaN, Double's Ord instance does not satisfy reflexivity.

>>> 0/0 <= (0/0 :: Double)
False

Also note that, due to the same, Ord's operator interactions are not respected by Double's instance:

>>> (0/0 :: Double) > 1
False
>>> compare (0/0 :: Double) 1
GT
Instance details

Defined in GHC.Classes

Read Double

Since: base-2.1

Instance details

Defined in GHC.Read

RealFloat Double

Since: base-2.1

Instance details

Defined in GHC.Float

Lift Double 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Double -> Q Exp #

Storable Double

Since: base-2.1

Instance details

Defined in Foreign.Storable

Hashable Double 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Double -> Int #

hash :: Double -> Int #

Semifield Double 
Instance details

Defined in Data.Semifield

Field Double 
Instance details

Defined in Data.Semifield

Real Double 
Instance details

Defined in Data.Semifield

Presemiring Double 
Instance details

Defined in Data.Semiring

Semiring Double 
Instance details

Defined in Data.Semiring

Ring Double 
Instance details

Defined in Data.Semiring

Maximal Double Source # 
Instance details

Defined in Data.Prd

Minimal Double Source # 
Instance details

Defined in Data.Prd

Prd Double Source # 
Instance details

Defined in Data.Prd

TripInt32 Double Source # 
Instance details

Defined in Data.Connection.Round

TripInt16 Double Source # 
Instance details

Defined in Data.Connection.Round

TripRatio Integer Double Source # 
Instance details

Defined in Data.Connection.Ratio

Generic1 (URec Double :: k -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Double) :: k -> Type #

Methods

from1 :: URec Double a -> Rep1 (URec Double) a #

to1 :: Rep1 (URec Double) a -> URec Double a #

Semigroup (Additive Double) 
Instance details

Defined in Data.Semigroup.Additive

Semigroup (Multiplicative Double) 
Instance details

Defined in Data.Semigroup.Multiplicative

Monoid (Additive Double) 
Instance details

Defined in Data.Semigroup.Additive

Monoid (Multiplicative Double) 
Instance details

Defined in Data.Semigroup.Multiplicative

Group (Additive Double) 
Instance details

Defined in Data.Semigroup.Additive

Group (Multiplicative Double) 
Instance details

Defined in Data.Semigroup.Multiplicative

Loop (Additive Double) 
Instance details

Defined in Data.Semigroup.Additive

Loop (Multiplicative Double) 
Instance details

Defined in Data.Semigroup.Multiplicative

Quasigroup (Additive Double) 
Instance details

Defined in Data.Semigroup.Additive

Quasigroup (Multiplicative Double) 
Instance details

Defined in Data.Semigroup.Multiplicative

Magma (Additive Double) 
Instance details

Defined in Data.Semigroup.Additive

Magma (Multiplicative Double) 
Instance details

Defined in Data.Semigroup.Multiplicative

Functor (URec Double :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Double a -> URec Double b #

(<$) :: a -> URec Double b -> URec Double a #

Foldable (URec Double :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => URec Double m -> m #

foldMap :: Monoid m => (a -> m) -> URec Double a -> m #

foldr :: (a -> b -> b) -> b -> URec Double a -> b #

foldr' :: (a -> b -> b) -> b -> URec Double a -> b #

foldl :: (b -> a -> b) -> b -> URec Double a -> b #

foldl' :: (b -> a -> b) -> b -> URec Double a -> b #

foldr1 :: (a -> a -> a) -> URec Double a -> a #

foldl1 :: (a -> a -> a) -> URec Double a -> a #

toList :: URec Double a -> [a] #

null :: URec Double a -> Bool #

length :: URec Double a -> Int #

elem :: Eq a => a -> URec Double a -> Bool #

maximum :: Ord a => URec Double a -> a #

minimum :: Ord a => URec Double a -> a #

sum :: Num a => URec Double a -> a #

product :: Num a => URec Double a -> a #

Traversable (URec Double :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> URec Double a -> f (URec Double b) #

sequenceA :: Applicative f => URec Double (f a) -> f (URec Double a) #

mapM :: Monad m => (a -> m b) -> URec Double a -> m (URec Double b) #

sequence :: Monad m => URec Double (m a) -> m (URec Double a) #

Eq (URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: URec Double p -> URec Double p -> Bool #

(/=) :: URec Double p -> URec Double p -> Bool #

Ord (URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec Double p -> URec Double p -> Ordering #

(<) :: URec Double p -> URec Double p -> Bool #

(<=) :: URec Double p -> URec Double p -> Bool #

(>) :: URec Double p -> URec Double p -> Bool #

(>=) :: URec Double p -> URec Double p -> Bool #

max :: URec Double p -> URec Double p -> URec Double p #

min :: URec Double p -> URec Double p -> URec Double p #

Show (URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Double p -> ShowS #

show :: URec Double p -> String #

showList :: [URec Double p] -> ShowS #

Generic (URec Double p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Double p) :: Type -> Type #

Methods

from :: URec Double p -> Rep (URec Double p) x #

to :: Rep (URec Double p) x -> URec Double p #

data URec Double (p :: k)

Used for marking occurrences of Double#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

data URec Double (p :: k) = UDouble {}
type Rep1 (URec Double :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (URec Double :: k -> Type) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UDouble" PrefixI True) (S1 (MetaSel (Just "uDouble#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UDouble :: k -> Type)))
type Rep (URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep (URec Double p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UDouble" PrefixI True) (S1 (MetaSel (Just "uDouble#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UDouble :: Type -> Type)))

newtype Ulp32 Source #

32 bit unit of least precision type.

Constructors

Ulp32 

Fields

Instances
Eq Ulp32 Source # 
Instance details

Defined in Data.Float

Methods

(==) :: Ulp32 -> Ulp32 -> Bool #

(/=) :: Ulp32 -> Ulp32 -> Bool #

Show Ulp32 Source # 
Instance details

Defined in Data.Float

Methods

showsPrec :: Int -> Ulp32 -> ShowS #

show :: Ulp32 -> String #

showList :: [Ulp32] -> ShowS #

Presemiring Ulp32 Source # 
Instance details

Defined in Data.Float

Semiring Ulp32 Source # 
Instance details

Defined in Data.Float

Maximal Ulp32 Source # 
Instance details

Defined in Data.Float

Methods

maximal :: Ulp32 Source #

Minimal Ulp32 Source # 
Instance details

Defined in Data.Float

Methods

minimal :: Ulp32 Source #

Prd Ulp32 Source # 
Instance details

Defined in Data.Float

Semigroup (Additive Ulp32) Source # 
Instance details

Defined in Data.Float

Semigroup (Multiplicative Ulp32) Source # 
Instance details

Defined in Data.Float

Semigroup (Meet Ulp32) Source # 
Instance details

Defined in Data.Float

Semigroup (Join Ulp32) Source # 
Instance details

Defined in Data.Float

Monoid (Additive Ulp32) Source # 
Instance details

Defined in Data.Float

Monoid (Multiplicative Ulp32) Source # 
Instance details

Defined in Data.Float

acos :: Double -> Double Source #

The acos function computes the principal value of the arc cosine of x in the range [0, pi]

asin :: Double -> Double Source #

The asin function computes the principal value of the arc sine of x in the range [-pi2, +pi2].

atan :: Double -> Double Source #

The atan function computes the principal value of the arc tangent of x in the range [-pi2, +pi2].

atan2 :: Double -> Double -> Double Source #

The atan2 function computes the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value.

cos :: Double -> Double Source #

The cos function computes the cosine of x (measured in radians). A large magnitude argument may yield a result with little or no significance. For a discussion of error due to roundoff, see math(3).

sin :: Double -> Double Source #

The sin function computes the sine of x (measured in radians). A large magnitude argument may yield a result with little or no significance. For a discussion of error due to roundoff, see math(3).

tan :: Double -> Double Source #

The tan function computes the tangent of x (measured in radians). A large magnitude argument may yield a result with little or no significance. For a discussion of error due to roundoff, see math(3).

cosh :: Double -> Double Source #

The cosh function computes the hyperbolic cosine of x.

sinh :: Double -> Double Source #

The sinh function computes the hyperbolic sine of x.

tanh :: Double -> Double Source #

The tanh function computes the hyperbolic tangent of x.

exp :: Double -> Double Source #

The exp() function computes the exponential value of the given argument x.

frexp :: Double -> (Double, Int) Source #

frexp convert floating-point number to fractional and integral components frexp is not defined in the Haskell 98 report.

ldexp :: Double -> Int -> Double Source #

The ldexp function multiplies a floating-point number by an integral power of 2. ldexp is not defined in the Haskell 98 report.

log :: Double -> Double Source #

The log() function computes the value of the natural logarithm of argument x.

log10 :: Double -> Double Source #

The log10 function computes the value of the logarithm of argument x to base 10. log10 is not defined in the Haskell 98 report.

modf :: Double -> (Double, Double) Source #

The modf function breaks the argument value into integral and fractional parts, each of which has the same sign as the argument. modf is not defined in the Haskell 98 report.

pow :: Double -> Double -> Double Source #

The pow function computes the value of x to the exponent y.

sqrt :: Double -> Double Source #

The sqrt function computes the non-negative square root of x.

ceil :: Double -> Double Source #

The ceil function returns the smallest integral value greater than or equal to x.

fabs :: Double -> Double Source #

The fabs function computes the absolute value of a floating-point number x.

floor :: Double -> Double Source #

The floor function returns the largest integral value less than or equal to x.

fmod :: Double -> Double -> Double Source #

The fmod function computes the floating-point remainder of x / y.

round :: Double -> Double Source #

The round function returns the nearest integral value to x; if x lies halfway between two integral values, then these functions return the integral value with the larger absolute value (i.e., it rounds away from zero).

trunc :: Double -> Double Source #

The fmod function computes the floating-point remainder of x / y.

erf :: Double -> Double Source #

The erf calculates the error function of x. The error function is defined as:

erf(x) = 2/sqrt(pi)*integral from 0 to x of exp(-t*t) dt.

erfc :: Double -> Double Source #

The erfc function calculates the complementary error function of x; that is erfc() subtracts the result of the error function erf(x) from 1.0. This is useful, since for large x places disappear.

gamma :: Double -> Double Source #

The gamma function.

hypot :: Double -> Double -> Double Source #

The hypot function function computes the sqrt(x*x+y*y) in such a way that underflow will not happen, and overflow occurs only if the final result deserves it.

hypot(Infinity, v) = hypot(v, Infinity) = +Infinity for all v, including NaN.

isinf :: Double -> Int Source #

The isinf function returns 1 if the number n is Infinity, otherwise 0.

isnan :: Double -> Int Source #

The isnan function returns 1 if the number n is ``not-a-number'', otherwise 0.

finite :: Double -> Int Source #

finite returns the value 1 just when -Infinity < x < +Infinity; otherwise a zero is returned (when |x| = Infinity or x is NaN.

j0 :: Double -> Double Source #

The functions j0() and j1() compute the Bessel function of the first kind of the order 0 and the order 1, respectively, for the real value x

j1 :: Double -> Double Source #

The functions j0() and j1() compute the Bessel function of the first kind of the order 0 and the order 1, respectively, for the real value x

y0 :: Double -> Double Source #

The functions y0() and y1() compute the linearly independent Bessel function of the second kind of the order 0 and the order 1, respectively, for the positive integer value x (expressed as a double)

y1 :: Double -> Double Source #

The functions y0() and y1() compute the linearly independent Bessel function of the second kind of the order 0 and the order 1, respectively, for the positive integer value x (expressed as a double)

yn :: Int -> Double -> Double Source #

yn() computes the Bessel function of the second kind for the integer Bessel0 n for the positive integer value x (expressed as a double).

lgamma :: Double -> Double Source #

lgamma(x) returns ln|| (x)|.

acosh :: Double -> Double Source #

The acosh function computes the inverse hyperbolic cosine of the real argument x.

asinh :: Double -> Double Source #

The asinh function computes the inverse hyperbolic sine of the real argument.

atanh :: Double -> Double Source #

The atanh function computes the inverse hyperbolic tangent of the real argument x.

cbrt :: Double -> Double Source #

The cbrt function computes the cube root of x.

logb :: Double -> Double Source #

logb x returns x's exponent n, a signed integer converted to double-precision floating-point.

logb(+-Infinity) = +Infinity;
logb(0) = -Infinity with a division by zero exception.

nextafter :: Double -> Double -> Double Source #

nextafter returns the next machine representable number from x in direction y.

remainder :: Double -> Double -> Double Source #

remainder returns the remainder r := x - n*y where n is the integer nearest the exact value of xy; moreover if |n - xy| = 1/2 then n is even. Consequently, the remainder is computed exactly and |r| <= |y|/2. But remainder(x, 0) and remainder(Infinity, 0) are invalid operations that produce a NaN. --

scalb :: Double -> Double -> Double Source #

scalb(x, n) returns x*(2**n) computed by exponent manipulation.

significand :: Double -> Double Source #

significand(x) returns sig, where x := sig * 2**n with 1 <= sig < 2. significand(x) is not defined when x is 0, +-Infinity, or NaN.

copysign :: Double -> Double -> Double Source #

copysign x y returns x with its sign changed to y's.

ilogb :: Double -> Int Source #

ilogb() returns x's exponent n, in integer format. ilogb(+-Infinity) re- turns INT_MAX and ilogb(0) returns INT_MIN.

rint :: Double -> Double Source #

The rint() function returns the integral value (represented as a double precision number) nearest to x according to the prevailing rounding mode.

eq :: Double -> Double -> Bool Source #

Determine bitwise equality.

maxNorm :: Double Source #

Maximum finite value.

>>> shift 1 maxNorm
Infinity

minNorm :: Double Source #

Minimum normalized value.

>>> shift (-1) minNorm
0

maxOdd :: Double Source #

Maximum representable odd integer.

 maxOdd = 2**53 - 1

maxOddf :: Float Source #

Maximum representable odd integer.

 maxOddf = 2**24 - 1

minSub :: Double Source #

Minimum (pos) value.

>>> shift (-1) minSub
0.0

epsilon :: Double Source #

Difference between 1 and the smallest representable value greater than 1.

split :: Double -> Either Double Double Source #

Split a Double symmetrically along the sign bit.

>>> split 0
Right 0.0
>>> split (shift (-1) 0)
Left (-0.0)

shift :: Int64 -> Double -> Double Source #

Shift by Int64 units of least precision.

ulps :: Double -> Double -> (Bool, Word64) Source #

Compute signed distance in units of least precision.

 ulps x (shift (abs n) x) == (True, abs n)

ulps' :: Double -> Double -> Word64 Source #

Compute distance in units of least precision.

 ulps' x (shift n x) == abs n

within :: Word64 -> Double -> Double -> Bool Source #

Compare two values for approximate equality.

Required accuracy is specified in units of least precision.

See also https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/.