2 - Copyright (C) 2009 Nick Bowler.
4 - License BSD2: 2-clause BSD license. See LICENSE for full terms.
5 - This is free software: you are free to change and redistribute it.
6 - There is NO WARRANTY, to the extent permitted by law.
9 -- | Generic classes for floating point types. The interface is loosely based
10 -- off of the C math library.
11 module Data
.Floating
.Classes
where
13 import Prelude
hiding (Floating
(..), RealFloat
(..))
15 data FPClassification
= FPInfinite | FPNaN | FPNormal | FPSubNormal | FPZero
16 deriving (Show, Read, Eq
, Enum
, Bounded
)
18 -- | Class for floating point types (real or complex-valued).
20 -- Minimal complete definition: everything.
21 class Fractional a
=> Floating a
where
39 -- | Class for real-valued floating point types.
41 -- Minimal complete definition: all except pi, infinity and nan.
42 class Floating a
=> RealFloat a
where
43 fma
:: a
-> a
-> a
-> a
44 copysign
:: a
-> a
-> a
45 nextafter
:: a
-> a
-> a
61 classify
:: a
-> FPClassification