GHC.Float

base-4.14.3.0: Basic libraries

Copyright | (c) The University of Glasgow 1994-2002 Portions obtained from hbc (c) Lennart Augusstson
License | see libraries/base/LICENSE
Maintainer | cvs-ghc@haskell.org
Stability | internal
Portability | non-portable (GHC Extensions)
Safe Haskell | Trustworthy
Language | Haskell2010

GHC.Float

Contents

- Monomorphic equality operators
- Orphan instances

Description

The types `Float` and `Double`, the classes `Floating` and `RealFloat` and casting between Word32 and Float and Word64 and Double.

Synopsis

- rationalToFloat :: Integer -> Integer -> Float
- rationalToDouble :: Integer -> Integer -> Double
- class Fractional a => Floating a where
  - pi :: a
  - exp, log, sqrt :: a -> a
  - (**), logBase :: a -> a -> a
  - sin, cos, tan :: a -> a
  - asin, acos, atan :: a -> a
  - sinh, cosh, tanh :: a -> a
  - asinh, acosh, atanh :: a -> a
  - log1p :: a -> a
  - expm1 :: a -> a
  - log1pexp :: a -> a
  - log1mexp :: a -> a
- class (RealFrac a, Floating a) => RealFloat a where
  - floatRadix :: a -> Integer
  - floatDigits :: a -> Int
  - floatRange :: a -> (Int, Int)
  - decodeFloat :: a -> (Integer, Int)
  - encodeFloat :: Integer -> Int -> a
  - exponent :: a -> Int
  - significand :: a -> a
  - scaleFloat :: Int -> a -> a
  - isNaN :: a -> Bool
  - isInfinite :: a -> Bool
  - isDenormalized :: a -> Bool
  - isNegativeZero :: a -> Bool
  - isIEEE :: a -> Bool
  - atan2 :: a -> a -> a
- data FFFormat
  - = FFExponent
  - | FFFixed
  - | FFGeneric
- stgDoubleToWord64 :: Double# -> Word#
- stgWord64ToDouble :: Word# -> Double#
- stgFloatToWord32 :: Float# -> Word#
- stgWord32ToFloat :: Word# -> Float#
- isDoubleFinite :: Double -> Int
- isDoubleNegativeZero :: Double -> Int
- isDoubleDenormalized :: Double -> Int
- isDoubleInfinite :: Double -> Int
- isDoubleNaN :: Double -> Int
- isFloatFinite :: Float -> Int
- isFloatNegativeZero :: Float -> Int
- isFloatDenormalized :: Float -> Int
- isFloatInfinite :: Float -> Int
- isFloatNaN :: Float -> Int
- log1mexpOrd :: (Ord a, Floating a) => a -> a
- showFloat :: RealFloat a => a -> ShowS
- formatRealFloat :: RealFloat a => FFFormat -> Maybe Int -> a -> String
- formatRealFloatAlt :: RealFloat a => FFFormat -> Maybe Int -> Bool -> a -> String
- roundTo :: Int -> Int -> [Int] -> (Int, [Int])
- floatToDigits :: RealFloat a => Integer -> a -> ([Int], Int)
- fromRat :: RealFloat a => Rational -> a
- fromRat' :: RealFloat a => Rational -> a
- minExpt :: Int
- maxExpt :: Int
- expt :: Integer -> Int -> Integer
- expts :: Array Int Integer
- maxExpt10 :: Int
- expts10 :: Array Int Integer
- integerLogBase :: Integer -> Integer -> Int
- fromRat'' :: RealFloat a => Int -> Int -> Integer -> Integer -> a
- plusFloat :: Float -> Float -> Float
- minusFloat :: Float -> Float -> Float
- timesFloat :: Float -> Float -> Float
- divideFloat :: Float -> Float -> Float
- negateFloat :: Float -> Float
- gtFloat :: Float -> Float -> Bool
- geFloat :: Float -> Float -> Bool
- ltFloat :: Float -> Float -> Bool
- leFloat :: Float -> Float -> Bool
- expFloat :: Float -> Float
- expm1Float :: Float -> Float
- logFloat :: Float -> Float
- log1pFloat :: Float -> Float
- sqrtFloat :: Float -> Float
- fabsFloat :: Float -> Float
- sinFloat :: Float -> Float
- cosFloat :: Float -> Float
- tanFloat :: Float -> Float
- asinFloat :: Float -> Float
- acosFloat :: Float -> Float
- atanFloat :: Float -> Float
- sinhFloat :: Float -> Float
- coshFloat :: Float -> Float
- tanhFloat :: Float -> Float
- asinhFloat :: Float -> Float
- acoshFloat :: Float -> Float
- atanhFloat :: Float -> Float
- powerFloat :: Float -> Float -> Float
- plusDouble :: Double -> Double -> Double
- minusDouble :: Double -> Double -> Double
- timesDouble :: Double -> Double -> Double
- divideDouble :: Double -> Double -> Double
- negateDouble :: Double -> Double
- gtDouble :: Double -> Double -> Bool
- geDouble :: Double -> Double -> Bool
- ltDouble :: Double -> Double -> Bool
- leDouble :: Double -> Double -> Bool
- double2Float :: Double -> Float
- float2Double :: Float -> Double
- expDouble :: Double -> Double
- expm1Double :: Double -> Double
- logDouble :: Double -> Double
- log1pDouble :: Double -> Double
- sqrtDouble :: Double -> Double
- fabsDouble :: Double -> Double
- sinDouble :: Double -> Double
- cosDouble :: Double -> Double
- tanDouble :: Double -> Double
- asinDouble :: Double -> Double
- acosDouble :: Double -> Double
- atanDouble :: Double -> Double
- sinhDouble :: Double -> Double
- coshDouble :: Double -> Double
- tanhDouble :: Double -> Double
- asinhDouble :: Double -> Double
- acoshDouble :: Double -> Double
- atanhDouble :: Double -> Double
- powerDouble :: Double -> Double -> Double
- word2Double :: Word -> Double
- word2Float :: Word -> Float
- showSignedFloat :: RealFloat a => (a -> ShowS) -> Int -> a -> ShowS
- clamp :: Int -> Int -> Int
- castWord32ToFloat :: Word32 -> Float
- castFloatToWord32 :: Float -> Word32
- castWord64ToDouble :: Word64 -> Double
- castDoubleToWord64 :: Double -> Word64
- data Float = F# Float#
- data Double = D# Double#
- data Float# :: TYPE 'FloatRep
- data Double# :: TYPE 'DoubleRep
- double2Int :: Double -> Int
- int2Double :: Int -> Double
- float2Int :: Float -> Int
- int2Float :: Int -> Float
- eqFloat :: Float -> Float -> Bool
- eqDouble :: Double -> Double -> Bool

# Documentation

rationalToFloat :: Integer -> Integer -> Float Source #

rationalToDouble :: Integer -> Integer -> Double Source #

class Fractional a => Floating a where Source #

Trigonometric and hyperbolic functions and related functions.

The Haskell Report defines no laws for `Floating`. However, `(`+`)`, `(`*`)` and `exp` are customarily expected to define an exponential field and have the following properties:

- `exp (a + b)` = `exp a * exp b`
- `exp (fromInteger 0)` = `fromInteger 1`

Minimal complete definition

pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh, asinh, acosh, atanh

Methods

pi :: a Source #

exp :: a -> a Source #

log :: a -> a Source #

sqrt :: a -> a Source #

(**) :: a -> a -> a infixr 8 Source #

logBase :: a -> a -> a Source #

sin :: a -> a Source #

cos :: a -> a Source #

tan :: a -> a Source #

asin :: a -> a Source #

acos :: a -> a Source #

atan :: a -> a Source #

sinh :: a -> a Source #

cosh :: a -> a Source #

tanh :: a -> a Source #

asinh :: a -> a Source #

acosh :: a -> a Source #

atanh :: a -> a Source #

log1p :: a -> a Source #

``log1p` x` computes ``log` (1 + x)`, but provides more precise results for small (absolute) values of `x` if possible.

Since: base-4.9.0.0

expm1 :: a -> a Source #

``expm1` x` computes ``exp` x - 1`, but provides more precise results for small (absolute) values of `x` if possible.

Since: base-4.9.0.0

log1pexp :: a -> a Source #

``log1pexp` x` computes ``log` (1 + `exp` x)`, but provides more precise results if possible.

Examples:

- if `x` is a large negative number, ``log` (1 + `exp` x)` will be imprecise for the reasons given in `log1p`.
- if ``exp` x` is close to `-1`, ``log` (1 + `exp` x)` will be imprecise for the reasons given in `expm1`.

Since: base-4.9.0.0

log1mexp :: a -> a Source #

``log1mexp` x` computes ``log` (1 - `exp` x)`, but provides more precise results if possible.

Examples:

- if `x` is a large negative number, ``log` (1 - `exp` x)` will be imprecise for the reasons given in `log1p`.
- if ``exp` x` is close to `1`, ``log` (1 - `exp` x)` will be imprecise for the reasons given in `expm1`.

Since: base-4.9.0.0

#### Instances

Instances details

Floating Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Double Source # exp :: Double -> Double Source # log :: Double -> Double Source # sqrt :: Double -> Double Source # (**) :: Double -> Double -> Double Source # logBase :: Double -> Double -> Double Source # sin :: Double -> Double Source # cos :: Double -> Double Source # tan :: Double -> Double Source # asin :: Double -> Double Source # acos :: Double -> Double Source # atan :: Double -> Double Source # sinh :: Double -> Double Source # cosh :: Double -> Double Source # tanh :: Double -> Double Source # asinh :: Double -> Double Source # acosh :: Double -> Double Source # atanh :: Double -> Double Source # log1p :: Double -> Double Source # expm1 :: Double -> Double Source # log1pexp :: Double -> Double Source # log1mexp :: Double -> Double Source #
Floating Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Float Source # exp :: Float -> Float Source # log :: Float -> Float Source # sqrt :: Float -> Float Source # (**) :: Float -> Float -> Float Source # logBase :: Float -> Float -> Float Source # sin :: Float -> Float Source # cos :: Float -> Float Source # tan :: Float -> Float Source # asin :: Float -> Float Source # acos :: Float -> Float Source # atan :: Float -> Float Source # sinh :: Float -> Float Source # cosh :: Float -> Float Source # tanh :: Float -> Float Source # asinh :: Float -> Float Source # acosh :: Float -> Float Source # atanh :: Float -> Float Source # log1p :: Float -> Float Source # expm1 :: Float -> Float Source # log1pexp :: Float -> Float Source # log1mexp :: Float -> Float Source #
Floating CDouble # |
Instance details Defined in Foreign.C.Types Methods pi :: CDouble Source # exp :: CDouble -> CDouble Source # log :: CDouble -> CDouble Source # sqrt :: CDouble -> CDouble Source # (**) :: CDouble -> CDouble -> CDouble Source # logBase :: CDouble -> CDouble -> CDouble Source # sin :: CDouble -> CDouble Source # cos :: CDouble -> CDouble Source # tan :: CDouble -> CDouble Source # asin :: CDouble -> CDouble Source # acos :: CDouble -> CDouble Source # atan :: CDouble -> CDouble Source # sinh :: CDouble -> CDouble Source # cosh :: CDouble -> CDouble Source # tanh :: CDouble -> CDouble Source # asinh :: CDouble -> CDouble Source # acosh :: CDouble -> CDouble Source # atanh :: CDouble -> CDouble Source # log1p :: CDouble -> CDouble Source # expm1 :: CDouble -> CDouble Source # log1pexp :: CDouble -> CDouble Source # log1mexp :: CDouble -> CDouble Source #
Floating CFloat # |
Instance details Defined in Foreign.C.Types Methods pi :: CFloat Source # exp :: CFloat -> CFloat Source # log :: CFloat -> CFloat Source # sqrt :: CFloat -> CFloat Source # (**) :: CFloat -> CFloat -> CFloat Source # logBase :: CFloat -> CFloat -> CFloat Source # sin :: CFloat -> CFloat Source # cos :: CFloat -> CFloat Source # tan :: CFloat -> CFloat Source # asin :: CFloat -> CFloat Source # acos :: CFloat -> CFloat Source # atan :: CFloat -> CFloat Source # sinh :: CFloat -> CFloat Source # cosh :: CFloat -> CFloat Source # tanh :: CFloat -> CFloat Source # asinh :: CFloat -> CFloat Source # acosh :: CFloat -> CFloat Source # atanh :: CFloat -> CFloat Source # log1p :: CFloat -> CFloat Source # expm1 :: CFloat -> CFloat Source # log1pexp :: CFloat -> CFloat Source # log1mexp :: CFloat -> CFloat Source #
Floating a => Floating (Down a) # | Since: base-4.14.0.0
Instance details Defined in Data.Ord Methods pi :: Down a Source # exp :: Down a -> Down a Source # log :: Down a -> Down a Source # sqrt :: Down a -> Down a Source # (**) :: Down a -> Down a -> Down a Source # logBase :: Down a -> Down a -> Down a Source # sin :: Down a -> Down a Source # cos :: Down a -> Down a Source # tan :: Down a -> Down a Source # asin :: Down a -> Down a Source # acos :: Down a -> Down a Source # atan :: Down a -> Down a Source # sinh :: Down a -> Down a Source # cosh :: Down a -> Down a Source # tanh :: Down a -> Down a Source # asinh :: Down a -> Down a Source # acosh :: Down a -> Down a Source # atanh :: Down a -> Down a Source # log1p :: Down a -> Down a Source # expm1 :: Down a -> Down a Source # log1pexp :: Down a -> Down a Source # log1mexp :: Down a -> Down a Source #
Floating a => Floating (Identity a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods pi :: Identity a Source # exp :: Identity a -> Identity a Source # log :: Identity a -> Identity a Source # sqrt :: Identity a -> Identity a Source # (**) :: Identity a -> Identity a -> Identity a Source # logBase :: Identity a -> Identity a -> Identity a Source # sin :: Identity a -> Identity a Source # cos :: Identity a -> Identity a Source # tan :: Identity a -> Identity a Source # asin :: Identity a -> Identity a Source # acos :: Identity a -> Identity a Source # atan :: Identity a -> Identity a Source # sinh :: Identity a -> Identity a Source # cosh :: Identity a -> Identity a Source # tanh :: Identity a -> Identity a Source # asinh :: Identity a -> Identity a Source # acosh :: Identity a -> Identity a Source # atanh :: Identity a -> Identity a Source # log1p :: Identity a -> Identity a Source # expm1 :: Identity a -> Identity a Source # log1pexp :: Identity a -> Identity a Source # log1mexp :: Identity a -> Identity a Source #
RealFloat a => Floating (Complex a) # | Since: base-2.1
Instance details Defined in Data.Complex Methods pi :: Complex a Source # exp :: Complex a -> Complex a Source # log :: Complex a -> Complex a Source # sqrt :: Complex a -> Complex a Source # (**) :: Complex a -> Complex a -> Complex a Source # logBase :: Complex a -> Complex a -> Complex a Source # sin :: Complex a -> Complex a Source # cos :: Complex a -> Complex a Source # tan :: Complex a -> Complex a Source # asin :: Complex a -> Complex a Source # acos :: Complex a -> Complex a Source # atan :: Complex a -> Complex a Source # sinh :: Complex a -> Complex a Source # cosh :: Complex a -> Complex a Source # tanh :: Complex a -> Complex a Source # asinh :: Complex a -> Complex a Source # acosh :: Complex a -> Complex a Source # atanh :: Complex a -> Complex a Source # log1p :: Complex a -> Complex a Source # expm1 :: Complex a -> Complex a Source # log1pexp :: Complex a -> Complex a Source # log1mexp :: Complex a -> Complex a Source #
Floating a => Floating (Op a b) # |
Instance details Defined in Data.Functor.Contravariant Methods pi :: Op a b Source # exp :: Op a b -> Op a b Source # log :: Op a b -> Op a b Source # sqrt :: Op a b -> Op a b Source # (**) :: Op a b -> Op a b -> Op a b Source # logBase :: Op a b -> Op a b -> Op a b Source # sin :: Op a b -> Op a b Source # cos :: Op a b -> Op a b Source # tan :: Op a b -> Op a b Source # asin :: Op a b -> Op a b Source # acos :: Op a b -> Op a b Source # atan :: Op a b -> Op a b Source # sinh :: Op a b -> Op a b Source # cosh :: Op a b -> Op a b Source # tanh :: Op a b -> Op a b Source # asinh :: Op a b -> Op a b Source # acosh :: Op a b -> Op a b Source # atanh :: Op a b -> Op a b Source # log1p :: Op a b -> Op a b Source # expm1 :: Op a b -> Op a b Source # log1pexp :: Op a b -> Op a b Source # log1mexp :: Op a b -> Op a b Source #
Floating a => Floating (Const a b) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods pi :: Const a b Source # exp :: Const a b -> Const a b Source # log :: Const a b -> Const a b Source # sqrt :: Const a b -> Const a b Source # (**) :: Const a b -> Const a b -> Const a b Source # logBase :: Const a b -> Const a b -> Const a b Source # sin :: Const a b -> Const a b Source # cos :: Const a b -> Const a b Source # tan :: Const a b -> Const a b Source # asin :: Const a b -> Const a b Source # acos :: Const a b -> Const a b Source # atan :: Const a b -> Const a b Source # sinh :: Const a b -> Const a b Source # cosh :: Const a b -> Const a b Source # tanh :: Const a b -> Const a b Source # asinh :: Const a b -> Const a b Source # acosh :: Const a b -> Const a b Source # atanh :: Const a b -> Const a b Source # log1p :: Const a b -> Const a b Source # expm1 :: Const a b -> Const a b Source # log1pexp :: Const a b -> Const a b Source # log1mexp :: Const a b -> Const a b Source #

class (RealFrac a, Floating a) => RealFloat a where Source #

Efficient, machine-independent access to the components of a floating-point number.

Minimal complete definition

floatRadix, floatDigits, floatRange, decodeFloat, encodeFloat, isNaN, isInfinite, isDenormalized, isNegativeZero, isIEEE

Methods

floatRadix :: a -> Integer Source #

a constant function, returning the radix of the representation (often `2`)

floatDigits :: a -> Int Source #

a constant function, returning the number of digits of `floatRadix` in the significand

floatRange :: a -> (Int, Int) Source #

a constant function, returning the lowest and highest values the exponent may assume

decodeFloat :: a -> (Integer, Int) Source #

The function `decodeFloat` applied to a real floating-point number returns the significand expressed as an `Integer` and an appropriately scaled exponent (an `Int`). If ``decodeFloat` x` yields `(m,n)`, then `x` is equal in value to `m*b^^n`, where `b` is the floating-point radix, and furthermore, either `m` and `n` are both zero or else `b^(d-1) <= `abs` m < b^d`, where `d` is the value of ``floatDigits` x`. In particular, ``decodeFloat` 0 = (0,0)`. If the type contains a negative zero, also ``decodeFloat` (-0.0) = (0,0)`. The result of ``decodeFloat` x` is unspecified if either of ``isNaN` x` or ``isInfinite` x` is `True`.

encodeFloat :: Integer -> Int -> a Source #

`encodeFloat` performs the inverse of `decodeFloat` in the sense that for finite `x` with the exception of `-0.0`, ``uncurry` `encodeFloat` (`decodeFloat` x) = x`. ``encodeFloat` m n` is one of the two closest representable floating-point numbers to `m*b^^n` (or `±Infinity` if overflow occurs); usually the closer, but if `m` contains too many bits, the result may be rounded in the wrong direction.

exponent :: a -> Int Source #

`exponent` corresponds to the second component of `decodeFloat`. ``exponent` 0 = 0` and for finite nonzero `x`, ``exponent` x = snd (`decodeFloat` x) + `floatDigits` x`. If `x` is a finite floating-point number, it is equal in value to ``significand` x * b ^^ `exponent` x`, where `b` is the floating-point radix. The behaviour is unspecified on infinite or `NaN` values.

significand :: a -> a Source #

The first component of `decodeFloat`, scaled to lie in the open interval (`-1`,`1`), either `0.0` or of absolute value `>= 1/b`, where `b` is the floating-point radix. The behaviour is unspecified on infinite or `NaN` values.

scaleFloat :: Int -> a -> a Source #

multiplies a floating-point number by an integer power of the radix

isNaN :: a -> Bool Source #

`True` if the argument is an IEEE "not-a-number" (NaN) value

isInfinite :: a -> Bool Source #

`True` if the argument is an IEEE infinity or negative infinity

isDenormalized :: a -> Bool Source #

`True` if the argument is too small to be represented in normalized format

isNegativeZero :: a -> Bool Source #

`True` if the argument is an IEEE negative zero

isIEEE :: a -> Bool Source #

`True` if the argument is an IEEE floating point number

atan2 :: a -> a -> a Source #

a version of arctangent taking two real floating-point arguments. For real floating `x` and `y`, ``atan2` y x` computes the angle (from the positive x-axis) of the vector from the origin to the point `(x,y)`. ``atan2` y x` returns a value in the range [`-pi`, `pi`]. It follows the Common Lisp semantics for the origin when signed zeroes are supported. ``atan2` y 1`, with `y` in a type that is `RealFloat`, should return the same value as ``atan` y`. A default definition of `atan2` is provided, but implementors can provide a more accurate implementation.

#### Instances

Instances details

RealFloat Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Double -> Integer Source # floatDigits :: Double -> Int Source # floatRange :: Double -> (Int, Int) Source # decodeFloat :: Double -> (Integer, Int) Source # encodeFloat :: Integer -> Int -> Double Source # exponent :: Double -> Int Source # significand :: Double -> Double Source # scaleFloat :: Int -> Double -> Double Source # isNaN :: Double -> Bool Source # isInfinite :: Double -> Bool Source # isDenormalized :: Double -> Bool Source # isNegativeZero :: Double -> Bool Source # isIEEE :: Double -> Bool Source # atan2 :: Double -> Double -> Double Source #
RealFloat Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Float -> Integer Source # floatDigits :: Float -> Int Source # floatRange :: Float -> (Int, Int) Source # decodeFloat :: Float -> (Integer, Int) Source # encodeFloat :: Integer -> Int -> Float Source # exponent :: Float -> Int Source # significand :: Float -> Float Source # scaleFloat :: Int -> Float -> Float Source # isNaN :: Float -> Bool Source # isInfinite :: Float -> Bool Source # isDenormalized :: Float -> Bool Source # isNegativeZero :: Float -> Bool Source # isIEEE :: Float -> Bool Source # atan2 :: Float -> Float -> Float Source #
RealFloat CDouble # |
Instance details Defined in Foreign.C.Types Methods floatRadix :: CDouble -> Integer Source # floatDigits :: CDouble -> Int Source # floatRange :: CDouble -> (Int, Int) Source # decodeFloat :: CDouble -> (Integer, Int) Source # encodeFloat :: Integer -> Int -> CDouble Source # exponent :: CDouble -> Int Source # significand :: CDouble -> CDouble Source # scaleFloat :: Int -> CDouble -> CDouble Source # isNaN :: CDouble -> Bool Source # isInfinite :: CDouble -> Bool Source # isDenormalized :: CDouble -> Bool Source # isNegativeZero :: CDouble -> Bool Source # isIEEE :: CDouble -> Bool Source # atan2 :: CDouble -> CDouble -> CDouble Source #
RealFloat CFloat # |
Instance details Defined in Foreign.C.Types Methods floatRadix :: CFloat -> Integer Source # floatDigits :: CFloat -> Int Source # floatRange :: CFloat -> (Int, Int) Source # decodeFloat :: CFloat -> (Integer, Int) Source # encodeFloat :: Integer -> Int -> CFloat Source # exponent :: CFloat -> Int Source # significand :: CFloat -> CFloat Source # scaleFloat :: Int -> CFloat -> CFloat Source # isNaN :: CFloat -> Bool Source # isInfinite :: CFloat -> Bool Source # isDenormalized :: CFloat -> Bool Source # isNegativeZero :: CFloat -> Bool Source # isIEEE :: CFloat -> Bool Source # atan2 :: CFloat -> CFloat -> CFloat Source #
RealFloat a => RealFloat (Down a) # | Since: base-4.14.0.0
Instance details Defined in Data.Ord Methods floatRadix :: Down a -> Integer Source # floatDigits :: Down a -> Int Source # floatRange :: Down a -> (Int, Int) Source # decodeFloat :: Down a -> (Integer, Int) Source # encodeFloat :: Integer -> Int -> Down a Source # exponent :: Down a -> Int Source # significand :: Down a -> Down a Source # scaleFloat :: Int -> Down a -> Down a Source # isNaN :: Down a -> Bool Source # isInfinite :: Down a -> Bool Source # isDenormalized :: Down a -> Bool Source # isNegativeZero :: Down a -> Bool Source # isIEEE :: Down a -> Bool Source # atan2 :: Down a -> Down a -> Down a Source #
RealFloat a => RealFloat (Identity a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods floatRadix :: Identity a -> Integer Source # floatDigits :: Identity a -> Int Source # floatRange :: Identity a -> (Int, Int) Source # decodeFloat :: Identity a -> (Integer, Int) Source # encodeFloat :: Integer -> Int -> Identity a Source # exponent :: Identity a -> Int Source # significand :: Identity a -> Identity a Source # scaleFloat :: Int -> Identity a -> Identity a Source # isNaN :: Identity a -> Bool Source # isInfinite :: Identity a -> Bool Source # isDenormalized :: Identity a -> Bool Source # isNegativeZero :: Identity a -> Bool Source # isIEEE :: Identity a -> Bool Source # atan2 :: Identity a -> Identity a -> Identity a Source #
RealFloat a => RealFloat (Const a b) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods floatRadix :: Const a b -> Integer Source # floatDigits :: Const a b -> Int Source # floatRange :: Const a b -> (Int, Int) Source # decodeFloat :: Const a b -> (Integer, Int) Source # encodeFloat :: Integer -> Int -> Const a b Source # exponent :: Const a b -> Int Source # significand :: Const a b -> Const a b Source # scaleFloat :: Int -> Const a b -> Const a b Source # isNaN :: Const a b -> Bool Source # isInfinite :: Const a b -> Bool Source # isDenormalized :: Const a b -> Bool Source # isNegativeZero :: Const a b -> Bool Source # isIEEE :: Const a b -> Bool Source # atan2 :: Const a b -> Const a b -> Const a b Source #

data FFFormat Source #

Constructors

FFExponent |
FFFixed |
FFGeneric |

stgDoubleToWord64 :: Double# -> Word# Source #

stgWord64ToDouble :: Word# -> Double# Source #

stgFloatToWord32 :: Float# -> Word# Source #

stgWord32ToFloat :: Word# -> Float# Source #

isDoubleFinite :: Double -> Int Source #

isDoubleNegativeZero :: Double -> Int Source #

isDoubleDenormalized :: Double -> Int Source #

isDoubleInfinite :: Double -> Int Source #

isDoubleNaN :: Double -> Int Source #

isFloatFinite :: Float -> Int Source #

isFloatNegativeZero :: Float -> Int Source #

isFloatDenormalized :: Float -> Int Source #

isFloatInfinite :: Float -> Int Source #

isFloatNaN :: Float -> Int Source #

log1mexpOrd :: (Ord a, Floating a) => a -> a Source #

Default implementation for ``log1mexp`` requiring ``Ord`` to test against a threshold to decide which implementation variant to use.

showFloat :: RealFloat a => a -> ShowS Source #

Show a signed `RealFloat` value to full precision using standard decimal notation for arguments whose absolute value lies between `0.1` and `9,999,999`, and scientific notation otherwise.

formatRealFloat :: RealFloat a => FFFormat -> Maybe Int -> a -> String Source #

formatRealFloatAlt :: RealFloat a => FFFormat -> Maybe Int -> Bool -> a -> String Source #

roundTo :: Int -> Int -> [Int] -> (Int, [Int]) Source #

floatToDigits :: RealFloat a => Integer -> a -> ([Int], Int) Source #

`floatToDigits` takes a base and a non-negative `RealFloat` number, and returns a list of digits and an exponent. In particular, if `x>=0`, and

    floatToDigits base x = ([d1,d2,...,dn], e)

then

1.     n >= 1

2.     x = 0.d1d2...dn * (base**e)

3.     0 <= di <= base-1

fromRat :: RealFloat a => Rational -> a Source #

Converts a `Rational` value into any type in class `RealFloat`.

fromRat' :: RealFloat a => Rational -> a Source #

minExpt :: Int Source #

maxExpt :: Int Source #

expt :: Integer -> Int -> Integer Source #

expts :: Array Int Integer Source #

maxExpt10 :: Int Source #

expts10 :: Array Int Integer Source #

integerLogBase :: Integer -> Integer -> Int Source #

fromRat'' :: RealFloat a => Int -> Int -> Integer -> Integer -> a Source #

plusFloat :: Float -> Float -> Float Source #

minusFloat :: Float -> Float -> Float Source #

timesFloat :: Float -> Float -> Float Source #

divideFloat :: Float -> Float -> Float Source #

negateFloat :: Float -> Float Source #

gtFloat :: Float -> Float -> Bool Source #

geFloat :: Float -> Float -> Bool Source #

ltFloat :: Float -> Float -> Bool Source #

leFloat :: Float -> Float -> Bool Source #

expFloat :: Float -> Float Source #

expm1Float :: Float -> Float Source #

logFloat :: Float -> Float Source #

log1pFloat :: Float -> Float Source #

sqrtFloat :: Float -> Float Source #

fabsFloat :: Float -> Float Source #

sinFloat :: Float -> Float Source #

cosFloat :: Float -> Float Source #

tanFloat :: Float -> Float Source #

asinFloat :: Float -> Float Source #

acosFloat :: Float -> Float Source #

atanFloat :: Float -> Float Source #

sinhFloat :: Float -> Float Source #

coshFloat :: Float -> Float Source #

tanhFloat :: Float -> Float Source #

asinhFloat :: Float -> Float Source #

acoshFloat :: Float -> Float Source #

atanhFloat :: Float -> Float Source #

powerFloat :: Float -> Float -> Float Source #

plusDouble :: Double -> Double -> Double Source #

minusDouble :: Double -> Double -> Double Source #

timesDouble :: Double -> Double -> Double Source #

divideDouble :: Double -> Double -> Double Source #

negateDouble :: Double -> Double Source #

gtDouble :: Double -> Double -> Bool Source #

geDouble :: Double -> Double -> Bool Source #

ltDouble :: Double -> Double -> Bool Source #

leDouble :: Double -> Double -> Bool Source #

double2Float :: Double -> Float Source #

float2Double :: Float -> Double Source #

expDouble :: Double -> Double Source #

expm1Double :: Double -> Double Source #

logDouble :: Double -> Double Source #

log1pDouble :: Double -> Double Source #

sqrtDouble :: Double -> Double Source #

fabsDouble :: Double -> Double Source #

sinDouble :: Double -> Double Source #

cosDouble :: Double -> Double Source #

tanDouble :: Double -> Double Source #

asinDouble :: Double -> Double Source #

acosDouble :: Double -> Double Source #

atanDouble :: Double -> Double Source #

sinhDouble :: Double -> Double Source #

coshDouble :: Double -> Double Source #

tanhDouble :: Double -> Double Source #

asinhDouble :: Double -> Double Source #

acoshDouble :: Double -> Double Source #

atanhDouble :: Double -> Double Source #

powerDouble :: Double -> Double -> Double Source #

word2Double :: Word -> Double Source #

word2Float :: Word -> Float Source #

showSignedFloat Source #

Arguments

:: RealFloat a |
=> (a -> ShowS) | a function that can show unsigned values
-> Int | the precedence of the enclosing context
-> a | the value to show
-> ShowS |

clamp :: Int -> Int -> Int Source #

castWord32ToFloat :: Word32 -> Float Source #

``castWord32ToFloat` w` does a bit-for-bit copy from an integral value to a floating-point value.

Since: base-4.10.0.0

castFloatToWord32 :: Float -> Word32 Source #

``castFloatToWord32` f` does a bit-for-bit copy from a floating-point value to an integral value.

Since: base-4.10.0.0

castWord64ToDouble :: Word64 -> Double Source #

``castWord64ToDouble` w` does a bit-for-bit copy from an integral value to a floating-point value.

Since: base-4.10.0.0

castDoubleToWord64 :: Double -> Word64 Source #

``castFloatToWord64` f` does a bit-for-bit copy from a floating-point value to an integral value.

Since: base-4.10.0.0

data Float Source #

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.

Constructors

F# Float# |

#### Instances

Instances details

Enum Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods succ :: Float -> Float Source # pred :: Float -> Float Source # toEnum :: Int -> Float Source # fromEnum :: Float -> Int Source # enumFrom :: Float -> [Float] Source # enumFromThen :: Float -> Float -> [Float] Source # enumFromTo :: Float -> Float -> [Float] Source # enumFromThenTo :: Float -> Float -> Float -> [Float] Source #
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 Source # (/=) :: Float -> Float -> Bool Source #
Floating Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Float Source # exp :: Float -> Float Source # log :: Float -> Float Source # sqrt :: Float -> Float Source # (**) :: Float -> Float -> Float Source # logBase :: Float -> Float -> Float Source # sin :: Float -> Float Source # cos :: Float -> Float Source # tan :: Float -> Float Source # asin :: Float -> Float Source # acos :: Float -> Float Source # atan :: Float -> Float Source # sinh :: Float -> Float Source # cosh :: Float -> Float Source # tanh :: Float -> Float Source # asinh :: Float -> Float Source # acosh :: Float -> Float Source # atanh :: Float -> Float Source # log1p :: Float -> Float Source # expm1 :: Float -> Float Source # log1pexp :: Float -> Float Source # log1mexp :: Float -> Float Source #
Fractional Float # | Note that due to the presence of `NaN`, not all elements of `Float` have an multiplicative inverse.
    >>> 0/0 * (recip 0/0 :: Float)
    NaN
Since: base-2.1
Instance details Defined in GHC.Float Methods (/) :: Float -> Float -> Float Source # recip :: Float -> Float Source # fromRational :: Rational -> Float Source #
Data Float # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Float -> c Float Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Float Source # toConstr :: Float -> Constr Source # dataTypeOf :: Float -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Float) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Float) Source # gmapT :: (forall b. Data b => b -> b) -> Float -> Float Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Float -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Float -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Float -> m Float Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float Source #
Num Float # | Note that due to the presence of `NaN`, not all elements of `Float` have an additive inverse.
    >>> 0/0 + (negate 0/0 :: Float)
    NaN
Also note that due to the presence of -0, `Float`'s `Num` instance doesn't have an additive identity
    >>> 0 + (-0 :: Float)
    0.0
Since: base-2.1
Instance details Defined in GHC.Float Methods (+) :: Float -> Float -> Float Source # (-) :: Float -> Float -> Float Source # (*) :: Float -> Float -> Float Source # negate :: Float -> Float Source # abs :: Float -> Float Source # signum :: Float -> Float Source # fromInteger :: Integer -> Float Source #
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 Source # (<) :: Float -> Float -> Bool Source # (<=) :: Float -> Float -> Bool Source # (>) :: Float -> Float -> Bool Source # (>=) :: Float -> Float -> Bool Source # max :: Float -> Float -> Float Source # min :: Float -> Float -> Float Source #
Read Float # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Float Source # readList :: ReadS [Float] Source # readPrec :: ReadPrec Float Source # readListPrec :: ReadPrec [Float] Source #
Real Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods toRational :: Float -> Rational Source #
RealFloat Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Float -> Integer Source # floatDigits :: Float -> Int Source # floatRange :: Float -> (Int, Int) Source # decodeFloat :: Float -> (Integer, Int) Source # encodeFloat :: Integer -> Int -> Float Source # exponent :: Float -> Int Source # significand :: Float -> Float Source # scaleFloat :: Int -> Float -> Float Source # isNaN :: Float -> Bool Source # isInfinite :: Float -> Bool Source # isDenormalized :: Float -> Bool Source # isNegativeZero :: Float -> Bool Source # isIEEE :: Float -> Bool Source # atan2 :: Float -> Float -> Float Source #
RealFrac Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods properFraction :: Integral b => Float -> (b, Float) Source # truncate :: Integral b => Float -> b Source # round :: Integral b => Float -> b Source # ceiling :: Integral b => Float -> b Source # floor :: Integral b => Float -> b Source #
Show Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods showsPrec :: Int -> Float -> ShowS Source # show :: Float -> String Source # showList :: [Float] -> ShowS Source #
Storable Float # | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Float -> Int Source # alignment :: Float -> Int Source # peekElemOff :: Ptr Float -> Int -> IO Float Source # pokeElemOff :: Ptr Float -> Int -> Float -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Float Source # pokeByteOff :: Ptr b -> Int -> Float -> IO () Source # peek :: Ptr Float -> IO Float Source # poke :: Ptr Float -> Float -> IO () Source #
PrintfArg Float # | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Float -> FieldFormatter Source # parseFormat :: Float -> ModifierParser Source #
Generic1 (URec Float :: k -> Type) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Float) :: k -> Type Source # Methods from1 :: forall (a :: k0). URec Float a -> Rep1 (URec Float) a Source # to1 :: forall (a :: k0). Rep1 (URec Float) a -> URec Float a Source #
Foldable (UFloat :: Type -> Type) # | Since: base-4.9.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => UFloat m -> m Source # foldMap :: Monoid m => (a -> m) -> UFloat a -> m Source # foldMap' :: Monoid m => (a -> m) -> UFloat a -> m Source # foldr :: (a -> b -> b) -> b -> UFloat a -> b Source # foldr' :: (a -> b -> b) -> b -> UFloat a -> b Source # foldl :: (b -> a -> b) -> b -> UFloat a -> b Source # foldl' :: (b -> a -> b) -> b -> UFloat a -> b Source # foldr1 :: (a -> a -> a) -> UFloat a -> a Source # foldl1 :: (a -> a -> a) -> UFloat a -> a Source # toList :: UFloat a -> [a] Source # null :: UFloat a -> Bool Source # length :: UFloat a -> Int Source # elem :: Eq a => a -> UFloat a -> Bool Source # maximum :: Ord a => UFloat a -> a Source # minimum :: Ord a => UFloat a -> a Source # sum :: Num a => UFloat a -> a Source # product :: Num a => UFloat a -> a Source #
Traversable (UFloat :: Type -> Type) # | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> UFloat a -> f (UFloat b) Source # sequenceA :: Applicative f => UFloat (f a) -> f (UFloat a) Source # mapM :: Monad m => (a -> m b) -> UFloat a -> m (UFloat b) Source # sequence :: Monad m => UFloat (m a) -> m (UFloat a) Source #
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 Source # (<$) :: a -> URec Float b -> URec Float a Source #
Eq (URec Float p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec Float p -> URec Float p -> Bool Source # (/=) :: URec Float p -> URec Float p -> Bool Source #
Ord (URec Float p) # |
Instance details Defined in GHC.Generics Methods compare :: URec Float p -> URec Float p -> Ordering Source # (<) :: URec Float p -> URec Float p -> Bool Source # (<=) :: URec Float p -> URec Float p -> Bool Source # (>) :: URec Float p -> URec Float p -> Bool Source # (>=) :: URec Float p -> URec Float p -> Bool Source # max :: URec Float p -> URec Float p -> URec Float p Source # min :: URec Float p -> URec Float p -> URec Float p Source #
Show (URec Float p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Float p -> ShowS Source # show :: URec Float p -> String Source # showList :: [URec Float p] -> ShowS Source #
Generic (URec Float p) # |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Float p) :: Type -> Type Source # Methods from :: URec Float p -> Rep (URec Float p) x Source # to :: Rep (URec Float p) x -> URec Float p Source #
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 { uFloat# :: Float# }
type Rep1 (URec Float :: k -> Type) # |
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 Source #

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.

Constructors

D# Double# |

#### Instances

Instances details

Enum Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods succ :: Double -> Double Source # pred :: Double -> Double Source # toEnum :: Int -> Double Source # fromEnum :: Double -> Int Source # enumFrom :: Double -> [Double] Source # enumFromThen :: Double -> Double -> [Double] Source # enumFromTo :: Double -> Double -> [Double] Source # enumFromThenTo :: Double -> Double -> Double -> [Double] Source #
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 Source # (/=) :: Double -> Double -> Bool Source #
Floating Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Double Source # exp :: Double -> Double Source # log :: Double -> Double Source # sqrt :: Double -> Double Source # (**) :: Double -> Double -> Double Source # logBase :: Double -> Double -> Double Source # sin :: Double -> Double Source # cos :: Double -> Double Source # tan :: Double -> Double Source # asin :: Double -> Double Source # acos :: Double -> Double Source # atan :: Double -> Double Source # sinh :: Double -> Double Source # cosh :: Double -> Double Source # tanh :: Double -> Double Source # asinh :: Double -> Double Source # acosh :: Double -> Double Source # atanh :: Double -> Double Source # log1p :: Double -> Double Source # expm1 :: Double -> Double Source # log1pexp :: Double -> Double Source # log1mexp :: Double -> Double Source #
Fractional Double # | Note that due to the presence of `NaN`, not all elements of `Double` have an multiplicative inverse.
    >>> 0/0 * (recip 0/0 :: Double)
    NaN
Since: base-2.1
Instance details Defined in GHC.Float Methods (/) :: Double -> Double -> Double Source # recip :: Double -> Double Source # fromRational :: Rational -> Double Source #
Data Double # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Double -> c Double Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Double Source # toConstr :: Double -> Constr Source # dataTypeOf :: Double -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Double) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Double) Source # gmapT :: (forall b. Data b => b -> b) -> Double -> Double Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Double -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Double -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Double -> m Double Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double Source #
Num Double # | Note that due to the presence of `NaN`, not all elements of `Double` have an additive inverse.
    >>> 0/0 + (negate 0/0 :: Double)
    NaN
Also note that due to the presence of -0, `Double`'s `Num` instance doesn't have an additive identity
    >>> 0 + (-0 :: Double)
    0.0
Since: base-2.1
Instance details Defined in GHC.Float Methods (+) :: Double -> Double -> Double Source # (-) :: Double -> Double -> Double Source # (*) :: Double -> Double -> Double Source # negate :: Double -> Double Source # abs :: Double -> Double Source # signum :: Double -> Double Source # fromInteger :: Integer -> Double Source #
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 Methods compare :: Double -> Double -> Ordering Source # (<) :: Double -> Double -> Bool Source # (<=) :: Double -> Double -> Bool Source # (>) :: Double -> Double -> Bool Source # (>=) :: Double -> Double -> Bool Source # max :: Double -> Double -> Double Source # min :: Double -> Double -> Double Source #
Read Double # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Double Source # readList :: ReadS [Double] Source # readPrec :: ReadPrec Double Source # readListPrec :: ReadPrec [Double] Source #
Real Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods toRational :: Double -> Rational Source #
RealFloat Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Double -> Integer Source # floatDigits :: Double -> Int Source # floatRange :: Double -> (Int, Int) Source # decodeFloat :: Double -> (Integer, Int) Source # encodeFloat :: Integer -> Int -> Double Source # exponent :: Double -> Int Source # significand :: Double -> Double Source # scaleFloat :: Int -> Double -> Double Source # isNaN :: Double -> Bool Source # isInfinite :: Double -> Bool Source # isDenormalized :: Double -> Bool Source # isNegativeZero :: Double -> Bool Source # isIEEE :: Double -> Bool Source # atan2 :: Double -> Double -> Double Source #
RealFrac Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods properFraction :: Integral b => Double -> (b, Double) Source # truncate :: Integral b => Double -> b Source # round :: Integral b => Double -> b Source # ceiling :: Integral b => Double -> b Source # floor :: Integral b => Double -> b Source #
Show Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods showsPrec :: Int -> Double -> ShowS Source # show :: Double -> String Source # showList :: [Double] -> ShowS Source #
Storable Double # | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Double -> Int Source # alignment :: Double -> Int Source # peekElemOff :: Ptr Double -> Int -> IO Double Source # pokeElemOff :: Ptr Double -> Int -> Double -> IO () Source # peekByteOff :: Ptr b -> Int -> IO Double Source # pokeByteOff :: Ptr b -> Int -> Double -> IO () Source # peek :: Ptr Double -> IO Double Source # poke :: Ptr Double -> Double -> IO () Source #
PrintfArg Double # | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Double -> FieldFormatter Source # parseFormat :: Double -> ModifierParser Source #
Generic1 (URec Double :: k -> Type) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Double) :: k -> Type Source # Methods from1 :: forall (a :: k0). URec Double a -> Rep1 (URec Double) a Source # to1 :: forall (a :: k0). Rep1 (URec Double) a -> URec Double a Source #
Foldable (UDouble :: Type -> Type) # | Since: base-4.9.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => UDouble m -> m Source # foldMap :: Monoid m => (a -> m) -> UDouble a -> m Source # foldMap' :: Monoid m => (a -> m) -> UDouble a -> m Source # foldr :: (a -> b -> b) -> b -> UDouble a -> b Source # foldr' :: (a -> b -> b) -> b -> UDouble a -> b Source # foldl :: (b -> a -> b) -> b -> UDouble a -> b Source # foldl' :: (b -> a -> b) -> b -> UDouble a -> b Source # foldr1 :: (a -> a -> a) -> UDouble a -> a Source # foldl1 :: (a -> a -> a) -> UDouble a -> a Source # toList :: UDouble a -> [a] Source # null :: UDouble a -> Bool Source # length :: UDouble a -> Int Source # elem :: Eq a => a -> UDouble a -> Bool Source # maximum :: Ord a => UDouble a -> a Source # minimum :: Ord a => UDouble a -> a Source # sum :: Num a => UDouble a -> a Source # product :: Num a => UDouble a -> a Source #
Traversable (UDouble :: Type -> Type) # | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> UDouble a -> f (UDouble b) Source # sequenceA :: Applicative f => UDouble (f a) -> f (UDouble a) Source # mapM :: Monad m => (a -> m b) -> UDouble a -> m (UDouble b) Source # sequence :: Monad m => UDouble (m a) -> m (UDouble a) Source #
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 Source # (<$) :: a -> URec Double b -> URec Double a Source #
Eq (URec Double p) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (==) :: URec Double p -> URec Double p -> Bool Source # (/=) :: URec Double p -> URec Double p -> Bool Source #
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 Source # (<) :: URec Double p -> URec Double p -> Bool Source # (<=) :: URec Double p -> URec Double p -> Bool Source # (>) :: URec Double p -> URec Double p -> Bool Source # (>=) :: URec Double p -> URec Double p -> Bool Source # max :: URec Double p -> URec Double p -> URec Double p Source # min :: URec Double p -> URec Double p -> URec Double p Source #
Show (URec Double p) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Double p -> ShowS Source # show :: URec Double p -> String Source # showList :: [URec Double p] -> ShowS Source #
Generic (URec Double p) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Associated Types type Rep (URec Double p) :: Type -> Type Source # Methods from :: URec Double p -> Rep (URec Double p) x Source # to :: Rep (URec Double p) x -> URec Double p Source #
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 { uDouble# :: Double# }
type Rep1 (URec Double :: k -> Type) # |
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) # |
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)))

data Float# :: TYPE 'FloatRep Source #

data Double# :: TYPE 'DoubleRep Source #

double2Int :: Double -> Int Source #

int2Double :: Int -> Double Source #

float2Int :: Float -> Int Source #

int2Float :: Int -> Float Source #

# Monomorphic equality operators

See GHC.Classes#matching_overloaded_methods_in_rules

eqFloat :: Float -> Float -> Bool Source #

eqDouble :: Double -> Double -> Bool Source #

# Orphan instances

Enum Double # | Since: base-2.1
Instance details Methods succ :: Double -> Double Source # pred :: Double -> Double Source # toEnum :: Int -> Double Source # fromEnum :: Double -> Int Source # enumFrom :: Double -> [Double] Source # enumFromThen :: Double -> Double -> [Double] Source # enumFromTo :: Double -> Double -> [Double] Source # enumFromThenTo :: Double -> Double -> Double -> [Double] Source #
Enum Float # | Since: base-2.1
Instance details Methods succ :: Float -> Float Source # pred :: Float -> Float Source # toEnum :: Int -> Float Source # fromEnum :: Float -> Int Source # enumFrom :: Float -> [Float] Source # enumFromThen :: Float -> Float -> [Float] Source # enumFromTo :: Float -> Float -> [Float] Source # enumFromThenTo :: Float -> Float -> Float -> [Float] Source #
Fractional Double # | Note that due to the presence of `NaN`, not all elements of `Double` have an multiplicative inverse.
    >>> 0/0 * (recip 0/0 :: Double)
    NaN
Since: base-2.1
Instance details Methods (/) :: Double -> Double -> Double Source # recip :: Double -> Double Source # fromRational :: Rational -> Double Source #
Fractional Float # | Note that due to the presence of `NaN`, not all elements of `Float` have an multiplicative inverse.
    >>> 0/0 * (recip 0/0 :: Float)
    NaN
Since: base-2.1
Instance details Methods (/) :: Float -> Float -> Float Source # recip :: Float -> Float Source # fromRational :: Rational -> Float Source #
Num Double # | Note that due to the presence of `NaN`, not all elements of `Double` have an additive inverse.
    >>> 0/0 + (negate 0/0 :: Double)
    NaN
Also note that due to the presence of -0, `Double`'s `Num` instance doesn't have an additive identity
    >>> 0 + (-0 :: Double)
    0.0
Since: base-2.1
Instance details Methods (+) :: Double -> Double -> Double Source # (-) :: Double -> Double -> Double Source # (*) :: Double -> Double -> Double Source # negate :: Double -> Double Source # abs :: Double -> Double Source # signum :: Double -> Double Source # fromInteger :: Integer -> Double Source #
Num Float # | Note that due to the presence of `NaN`, not all elements of `Float` have an additive inverse.
    >>> 0/0 + (negate 0/0 :: Float)
    NaN
Also note that due to the presence of -0, `Float`'s `Num` instance doesn't have an additive identity
    >>> 0 + (-0 :: Float)
    0.0
Since: base-2.1
Instance details Methods (+) :: Float -> Float -> Float Source # (-) :: Float -> Float -> Float Source # (*) :: Float -> Float -> Float Source # negate :: Float -> Float Source # abs :: Float -> Float Source # signum :: Float -> Float Source # fromInteger :: Integer -> Float Source #
Real Double # | Since: base-2.1
Instance details Methods toRational :: Double -> Rational Source #
Real Float # | Since: base-2.1
Instance details Methods toRational :: Float -> Rational Source #
RealFrac Double # | Since: base-2.1
Instance details Methods properFraction :: Integral b => Double -> (b, Double) Source # truncate :: Integral b => Double -> b Source # round :: Integral b => Double -> b Source # ceiling :: Integral b => Double -> b Source # floor :: Integral b => Double -> b Source #
RealFrac Float # | Since: base-2.1
Instance details Methods properFraction :: Integral b => Float -> (b, Float) Source # truncate :: Integral b => Float -> b Source # round :: Integral b => Float -> b Source # ceiling :: Integral b => Float -> b Source # floor :: Integral b => Float -> b Source #
Show Double # | Since: base-2.1
Instance details Methods showsPrec :: Int -> Double -> ShowS Source # show :: Double -> String Source # showList :: [Double] -> ShowS Source #
Show Float # | Since: base-2.1
Instance details Methods showsPrec :: Int -> Float -> ShowS Source # show :: Float -> String Source # showList :: [Float] -> ShowS Source #