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

Safe HaskellNone
LanguageHaskell2010

Data.Float

Contents

Synopsis

Float

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

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 () #

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

Triple Rational Float Source # 
Instance details

Defined in Data.Connection

Triple Float (Extended Int8) Source # 
Instance details

Defined in Data.Connection

Triple Float (Extended Int16) Source # 
Instance details

Defined in Data.Connection

Connection Float (Nan Int32) Source # 
Instance details

Defined in Data.Connection

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 #

Connection (Nan Int32) Float Source # 
Instance details

Defined in Data.Connection

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)))

eqf :: Float -> Float -> Bool Source #

Determine bitwise equality.

minSubf :: Float Source #

Minimum positive float value.

>>> minSubf
1.0e-45
>>> shiftf (-1) minSubf
0

minNormf :: Float Source #

Minimum normalized value.

>>> shiftf (-1) minNormf
0

maxOddf :: Float Source #

Maximum representable odd integer.

maxOddf = 2**24 - 1

maxNormf :: Float Source #

Maximum finite value.

maxNormf = shiftf (-1) maximal
>>> shiftf 1 maxNormf
Infinity

epsilonf :: Float Source #

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

epsilonf = shiftf 1 1 - 1

Double

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

Storable Double

Since: base-2.1

Instance details

Defined in Foreign.Storable

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

Triple Rational Double Source # 
Instance details

Defined in Data.Connection

Triple Double (Extended Int8) Source # 
Instance details

Defined in Data.Connection

Triple Double (Extended Int16) Source # 
Instance details

Defined in Data.Connection

Triple Double (Extended Int32) Source # 
Instance details

Defined in Data.Connection

Connection Double (Nan Int) Source # 
Instance details

Defined in Data.Connection

Connection Double (Nan Int64) Source # 
Instance details

Defined in Data.Connection

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 #

Connection (Nan Int) Double Source # 
Instance details

Defined in Data.Connection

Connection (Nan Int64) Double Source # 
Instance details

Defined in Data.Connection

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)))

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

Determine bitwise equality.

minSub :: Double Source #

Minimum positive value.

>>> shift (-1) minSub
0.0

minNorm :: Double Source #

Minimum normalized value.

>>> shift (-1) minNorm
2.8480945388892175e-306

maxOdd :: Double Source #

Maximum representable odd integer.

maxOdd = 2**53 - 1

maxNorm :: Double Source #

Maximum finite value.

maxNorm = shift (-1) maximal
>>> shift 1 maxNorm
Infinity

epsilon :: Double Source #

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

epsilon = shift 1 1 - 1

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).

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.

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.

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.

exp :: Double -> Double Source #

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

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

Convert a floating-point number to fractional and integral components

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.

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.

floor :: Double -> Double Source #

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

ceiling :: Double -> Double Source #

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

round :: Double -> Double Source #

Return the nearest value to x.

If x lies halfway between two values, then return the value with the larger absolute value (i.e. round away from zero).

truncate :: Double -> Double Source #

The trunctate function truncates towards zero.

fabs :: Double -> Double Source #

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

fmod :: Double -> 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.

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.

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)|.

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.