altfloat-0.2.2: Alternative floating point support for GHC.Source codeContentsIndex
Data.Floating.Classes
Description
Generic classes for floating point types. The interface is loosely based off of the C math library.
Synopsis
data FPClassification
= FPInfinite
| FPNaN
| FPNormal
| FPSubNormal
| FPZero
class (Fractional a, Poset a) => Roundable a where
toIntegral :: Integral b => a -> Maybe b
ceiling :: a -> a
floor :: a -> a
truncate :: a -> a
round :: a -> a
class Fractional a => Floating a where
(**) :: a -> a -> a
sqrt :: a -> a
acos :: a -> a
asin :: a -> a
atan :: a -> a
cos :: a -> a
sin :: a -> a
tan :: a -> a
acosh :: a -> a
asinh :: a -> a
atanh :: a -> a
cosh :: a -> a
sinh :: a -> a
tanh :: a -> a
exp :: a -> a
log :: a -> a
class Floating a => RealFloat a where
fma :: a -> a -> a -> a
copysign :: a -> a -> a
nextafter :: a -> a -> a
atan2 :: a -> a -> a
fmod :: a -> a -> a
frem :: a -> a -> a
fquotRem :: a -> a -> (Int, a)
hypot :: a -> a -> a
cbrt :: a -> a
exp2 :: a -> a
expm1 :: a -> a
log10 :: a -> a
log1p :: a -> a
log2 :: a -> a
logb :: a -> a
erf :: a -> a
erfc :: a -> a
lgamma :: a -> a
tgamma :: a -> a
classify :: a -> FPClassification
infinity :: a
nan :: a
pi :: a
Documentation
data FPClassification Source
Classification of floating point values.
Constructors
FPInfinite
FPNaN
FPNormal
FPSubNormal
FPZero
show/hide Instances
class (Fractional a, Poset a) => Roundable a whereSource

Class for types which can be rounded to integers. The rounding functions in the Prelude are inadequate for floating point because they shoehorn their results into an integral type.

Minimal complete definition: toIntegral and round.

Methods
toIntegral :: Integral b => a -> Maybe bSource
Discards the fractional component from a value. Results in Nothing if the result cannot be represented as an integer, such as if the input is infinite or NaN.
ceiling :: a -> aSource
floor :: a -> aSource
truncate :: a -> aSource
round :: a -> aSource
show/hide Instances
class Fractional a => Floating a whereSource

Class for floating point types (real or complex-valued).

Minimal complete definition: everything.

Methods
(**) :: a -> a -> aSource
sqrt :: a -> aSource
acos :: a -> aSource
asin :: a -> aSource
atan :: a -> aSource
cos :: a -> aSource
sin :: a -> aSource
tan :: a -> aSource
acosh :: a -> aSource
asinh :: a -> aSource
atanh :: a -> aSource
cosh :: a -> aSource
sinh :: a -> aSource
tanh :: a -> aSource
exp :: a -> aSource
log :: a -> aSource
show/hide Instances
class Floating a => RealFloat a whereSource

Class for real-valued floating point types.

Minimal complete definition: all except pi, infinity and nan.

Methods
fma :: a -> a -> a -> aSource
copysign :: a -> a -> aSource
nextafter :: a -> a -> aSource
atan2 :: a -> a -> aSource
fmod :: a -> a -> aSource
frem :: a -> a -> aSource
fquotRem :: a -> a -> (Int, a)Source
hypot :: a -> a -> aSource
cbrt :: a -> aSource
exp2 :: a -> aSource
expm1 :: a -> aSource
log10 :: a -> aSource
log1p :: a -> aSource
log2 :: a -> aSource
logb :: a -> aSource
erf :: a -> aSource
erfc :: a -> aSource
lgamma :: a -> aSource
tgamma :: a -> aSource
classify :: a -> FPClassificationSource
infinity :: aSource
nan :: aSource
pi :: aSource
show/hide Instances
Produced by Haddock version 2.7.2