| Copyright | (c) The University of Glasgow 1994-2002 Portions obtained from hbc (c) Lennart Augusstson |
|---|---|
| License | see libraries/base/LICENSE |
| Maintainer | ghc-devs@haskell.org |
| Stability | internal |
| Portability | non-portable (GHC Extensions) |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
GHC.Internal.Float
Description
Synopsis
- class Fractional a => Floating a where
- pi :: a
- exp :: a -> a
- log :: a -> a
- sqrt :: a -> a
- (**) :: a -> a -> a
- logBase :: a -> a -> a
- sin :: a -> a
- cos :: a -> a
- tan :: a -> a
- asin :: a -> a
- acos :: a -> a
- atan :: a -> a
- sinh :: a -> a
- cosh :: a -> a
- tanh :: a -> a
- asinh :: a -> a
- acosh :: a -> a
- 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 Float = F# Float#
- data Float# :: TYPE 'FloatRep
- float2Int :: Float -> Int
- int2Float :: Int -> Float
- word2Float :: Word -> Float
- integerToFloat# :: Integer -> Float#
- naturalToFloat# :: Natural -> Float#
- rationalToFloat :: Integer -> Integer -> Float
- castWord32ToFloat :: Word32 -> Float
- castFloatToWord32 :: Float -> Word32
- castWord32ToFloat# :: Word32# -> Float#
- castFloatToWord32# :: Float# -> Word32#
- float2Double :: Float -> Double
- floorFloat :: Integral b => Float -> b
- ceilingFloat :: Integral b => Float -> b
- truncateFloat :: Integral b => Float -> b
- roundFloat :: Integral b => Float -> b
- properFractionFloat :: Integral b => Float -> (b, Float)
- isFloatDenormalized :: Float -> Int
- isFloatFinite :: Float -> Int
- isFloatInfinite :: Float -> Int
- isFloatNaN :: Float -> Int
- isFloatNegativeZero :: Float -> Int
- gtFloat :: Float -> Float -> Bool
- geFloat :: Float -> Float -> Bool
- leFloat :: Float -> Float -> Bool
- ltFloat :: Float -> Float -> Bool
- plusFloat :: Float -> Float -> Float
- minusFloat :: Float -> Float -> Float
- timesFloat :: Float -> Float -> Float
- divideFloat :: Float -> Float -> Float
- negateFloat :: Float -> Float
- 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
- data Double = D# Double#
- data Double# :: TYPE 'DoubleRep
- double2Int :: Double -> Int
- int2Double :: Int -> Double
- word2Double :: Word -> Double
- integerToDouble# :: Integer -> Double#
- naturalToDouble# :: Natural -> Double#
- rationalToDouble :: Integer -> Integer -> Double
- castWord64ToDouble :: Word64 -> Double
- castDoubleToWord64 :: Double -> Word64
- castWord64ToDouble# :: Word64# -> Double#
- castDoubleToWord64# :: Double# -> Word64#
- double2Float :: Double -> Float
- floorDouble :: Integral b => Double -> b
- ceilingDouble :: Integral b => Double -> b
- truncateDouble :: Integral b => Double -> b
- roundDouble :: Integral b => Double -> b
- properFractionDouble :: Integral b => Double -> (b, Double)
- isDoubleDenormalized :: Double -> Int
- isDoubleFinite :: Double -> Int
- isDoubleInfinite :: Double -> Int
- isDoubleNaN :: Double -> Int
- isDoubleNegativeZero :: Double -> Int
- gtDouble :: Double -> Double -> Bool
- geDouble :: Double -> Double -> Bool
- leDouble :: Double -> Double -> Bool
- ltDouble :: Double -> Double -> Bool
- plusDouble :: Double -> Double -> Double
- minusDouble :: Double -> Double -> Double
- timesDouble :: Double -> Double -> Double
- divideDouble :: Double -> Double -> Double
- negateDouble :: Double -> 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
- showFloat :: RealFloat a => a -> ShowS
- data FFFormat
- formatRealFloat :: RealFloat a => FFFormat -> Maybe Int -> a -> String
- formatRealFloatAlt :: RealFloat a => FFFormat -> Maybe Int -> Bool -> a -> String
- showSignedFloat :: RealFloat a => (a -> ShowS) -> Int -> a -> ShowS
- log1mexpOrd :: (Ord a, Floating a) => a -> a
- roundTo :: Int -> Int -> [Int] -> (Int, [Int])
- floatToDigits :: RealFloat a => Integer -> a -> ([Int], Int)
- integerToBinaryFloat' :: RealFloat a => Integer -> a
- fromRat :: RealFloat a => Rational -> a
- fromRat' :: RealFloat a => Rational -> a
- roundingMode# :: Integer -> Int# -> Int#
- eqFloat :: Float -> Float -> Bool
- eqDouble :: Double -> Double -> Bool
- clamp :: Int -> Int -> Int
- expt :: Integer -> Int -> Integer
- expts :: Array Int Integer
- expts10 :: Array Int Integer
- fromRat'' :: RealFloat a => Int -> Int -> Integer -> Integer -> a
- maxExpt :: Int
- maxExpt10 :: Int
- minExpt :: Int
- powerDouble :: Double -> Double -> Double
- powerFloat :: Float -> Float -> Float
- stgDoubleToWord64 :: Double# -> Word64#
- stgFloatToWord32 :: Float# -> Word32#
- stgWord64ToDouble :: Word64# -> Double#
- stgWord32ToFloat :: Word32# -> Float#
Classes
class Fractional a => Floating a where #
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 bexp (fromInteger 0)=fromInteger 1
Minimal complete definition
pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh, asinh, acosh, atanh
Methods
(**) :: a -> a -> a infixr 8 #
computes log1p x, but provides more precise
results for small (absolute) values of log (1 + x)x if possible.
Since: base-4.9.0.0
computes expm1 x, but provides more precise
results for small (absolute) values of exp x - 1x if possible.
Since: base-4.9.0.0
Instances
class (RealFrac a, Floating a) => RealFloat a where #
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 #
a constant function, returning the radix of the representation
(often 2)
floatDigits :: a -> Int #
a constant function, returning the number of digits of
floatRadix in the significand
floatRange :: a -> (Int, Int) #
A constant function, returning the lowest and highest values
that may assume for a normal exponent xx.
The relation to IEEE emin and emax is
.floatRange x = (emin + 1, emax + 1)
decodeFloat :: a -> (Integer, Int) #
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
yields decodeFloat x(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) <= , where abs m < b^dd is
the value of .
In particular, floatDigits x. If the type
contains a negative zero, also decodeFloat 0 = (0,0).
The result of decodeFloat (-0.0) = (0,0) is unspecified if either of
decodeFloat x or isNaN x is isInfinite xTrue.
encodeFloat :: Integer -> Int -> a #
encodeFloat performs the inverse of decodeFloat in the
sense that for finite x with the exception of -0.0,
.
uncurry encodeFloat (decodeFloat x) = x is one of the two closest representable
floating-point numbers to encodeFloat m nm*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 corresponds to the second component of decodeFloat.
and for finite nonzero exponent 0 = 0x,
.
If exponent x = snd (decodeFloat x) + floatDigits xx is a finite floating-point number, it is equal in value to
, where significand x * b ^^ exponent xb is the
floating-point radix.
The behaviour is unspecified on infinite or NaN values.
significand :: a -> a #
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 #
multiplies a floating-point number by an integer power of the radix
True if the argument is an IEEE "not-a-number" (NaN) value
isInfinite :: a -> Bool #
True if the argument is an IEEE infinity or negative infinity
isDenormalized :: a -> Bool #
True if the argument is too small to be represented in
normalized format
isNegativeZero :: a -> Bool #
True if the argument is an IEEE negative zero
True if the argument is an IEEE floating point number
a version of arctangent taking two real floating-point arguments.
For real floating x and y, computes the angle
(from the positive x-axis) of the vector from the origin to the
point atan2 y x(x,y). returns a value in the range [atan2 y x-pi,
pi]. It follows the Common Lisp semantics for the origin when
signed zeroes are supported. , with atan2 y 1y in a type
that is RealFloat, should return the same value as .
A default definition of atan yatan2 is provided, but implementors
can provide a more accurate implementation.
Instances
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
Also note that
| ||||
| Ord Float # | See | ||||
| Data Float # | Since: base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Float -> c Float # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Float # dataTypeOf :: Float -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Float) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Float) # gmapT :: (forall b. Data b => b -> b) -> Float -> Float # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r # gmapQ :: (forall d. Data d => d -> u) -> Float -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Float -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Float -> m Float # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float # | |||||
| Enum Float # |
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
Since: base-2.1 | ||||
Defined in GHC.Internal.Float | |||||
| Floating Float # | Since: base-2.1 | ||||
| RealFloat Float # | Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods floatRadix :: Float -> Integer # floatDigits :: Float -> Int # floatRange :: Float -> (Int, Int) # decodeFloat :: Float -> (Integer, Int) # encodeFloat :: Integer -> Int -> Float # significand :: Float -> Float # scaleFloat :: Int -> Float -> Float # isInfinite :: Float -> Bool # isDenormalized :: Float -> Bool # isNegativeZero :: Float -> Bool # | |||||
| Storable Float # | Since: base-2.1 | ||||
| Num Float # | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
Since: base-2.1 | ||||
| Read Float # | Since: base-2.1 | ||||
| Fractional Float # | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.
Since: base-2.1 | ||||
| Real Float # | Beware that
Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods toRational :: Float -> Rational # | |||||
| RealFrac Float # | Beware that results for non-finite arguments are garbage:
and get even more non-sensical if you ask for Since: base-2.1 | ||||
| Show Float # | Since: base-2.1 | ||||
| Lift Float # | |||||
| Generic1 (URec Float :: k -> Type) # | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Foldable (UFloat :: Type -> Type) # | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UFloat m -> m # foldMap :: Monoid m => (a -> m) -> UFloat a -> m # foldMap' :: Monoid m => (a -> m) -> UFloat a -> m # foldr :: (a -> b -> b) -> b -> UFloat a -> b # foldr' :: (a -> b -> b) -> b -> UFloat a -> b # foldl :: (b -> a -> b) -> b -> UFloat a -> b # foldl' :: (b -> a -> b) -> b -> UFloat a -> b # foldr1 :: (a -> a -> a) -> UFloat a -> a # foldl1 :: (a -> a -> a) -> UFloat a -> a # elem :: Eq a => a -> UFloat a -> Bool # maximum :: Ord a => UFloat a -> a # minimum :: Ord a => UFloat a -> a # | |||||
| Traversable (UFloat :: Type -> Type) # | Since: base-4.9.0.0 | ||||
| Functor (URec Float :: Type -> Type) # | Since: base-4.9.0.0 | ||||
| Eq (URec Float p) # | |||||
| Ord (URec Float p) # | |||||
Defined in GHC.Internal.Generics | |||||
| Generic (URec Float p) # | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Show (URec Float p) # | |||||
| data URec Float (p :: k) # | Used for marking occurrences of Since: base-4.9.0.0 | ||||
| type Rep1 (URec Float :: k -> Type) # | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type Rep (URec Float p) # | |||||
Defined in GHC.Internal.Generics | |||||
Conversion
word2Float :: Word -> Float #
integerToFloat# :: Integer -> Float# #
Convert an Integer to a Float#
naturalToFloat# :: Natural -> Float# #
Convert a Natural to a Float#
rationalToFloat :: Integer -> Integer -> Float #
castWord32ToFloat :: Word32 -> Float #
does a bit-for-bit copy from an integral value
to a floating-point value.castWord32ToFloat w
Since: base-4.11.0.0
castFloatToWord32 :: Float -> Word32 #
does a bit-for-bit copy from a floating-point value
to an integral value.castFloatToWord32 f
Since: base-4.11.0.0
castWord32ToFloat# :: Word32# -> Float# #
Bitcast a Word32# into a Float#
castFloatToWord32# :: Float# -> Word32# #
Bitcast a Float# into a Word32#
float2Double :: Float -> Double #
Operations
floorFloat :: Integral b => Float -> b #
ceilingFloat :: Integral b => Float -> b #
truncateFloat :: Integral b => Float -> b #
roundFloat :: Integral b => Float -> b #
properFractionFloat :: Integral b => Float -> (b, Float) #
Predicate
isFloatDenormalized :: Float -> Int #
isFloatFinite :: Float -> Int #
isFloatInfinite :: Float -> Int #
isFloatNaN :: Float -> Int #
isFloatNegativeZero :: Float -> Int #
Comparison
Arithmetic
minusFloat :: Float -> Float -> Float #
timesFloat :: Float -> Float -> Float #
divideFloat :: Float -> Float -> Float #
negateFloat :: Float -> Float #
expm1Float :: Float -> Float #
log1pFloat :: Float -> Float #
asinhFloat :: Float -> Float #
acoshFloat :: Float -> Float #
atanhFloat :: Float -> Float #
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
Also note that
| ||||
| Ord Double # | IEEE 754 IEEE 754-2008, section 5.11 requires that if at least one of arguments of
IEEE 754-2008, section 5.10 defines Thus, users must be extremely cautious when using Moving further, the behaviour of IEEE 754-2008 compliant | ||||
| Data Double # | Since: base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Double -> c Double # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Double # toConstr :: Double -> Constr # dataTypeOf :: Double -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Double) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Double) # gmapT :: (forall b. Data b => b -> b) -> Double -> Double # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r # gmapQ :: (forall d. Data d => d -> u) -> Double -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Double -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Double -> m Double # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double # | |||||
| Enum Double # |
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
Since: base-2.1 | ||||
Defined in GHC.Internal.Float | |||||
| Floating Double # | Since: base-2.1 | ||||
| RealFloat Double # | Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods floatRadix :: Double -> Integer # floatDigits :: Double -> Int # floatRange :: Double -> (Int, Int) # decodeFloat :: Double -> (Integer, Int) # encodeFloat :: Integer -> Int -> Double # significand :: Double -> Double # scaleFloat :: Int -> Double -> Double # isInfinite :: Double -> Bool # isDenormalized :: Double -> Bool # isNegativeZero :: Double -> Bool # | |||||
| Storable Double # | Since: base-2.1 | ||||
| Num Double # | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
Since: base-2.1 | ||||
| Read Double # | Since: base-2.1 | ||||
| Fractional Double # | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.
Since: base-2.1 | ||||
| Real Double # | Beware that
Since: base-2.1 | ||||
Defined in GHC.Internal.Float Methods toRational :: Double -> Rational # | |||||
| RealFrac Double # | Beware that results for non-finite arguments are garbage:
and get even more non-sensical if you ask for Since: base-2.1 | ||||
| Show Double # | Since: base-2.1 | ||||
| Lift Double # | |||||
| Generic1 (URec Double :: k -> Type) # | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Foldable (UDouble :: Type -> Type) # | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UDouble m -> m # foldMap :: Monoid m => (a -> m) -> UDouble a -> m # foldMap' :: Monoid m => (a -> m) -> UDouble a -> m # foldr :: (a -> b -> b) -> b -> UDouble a -> b # foldr' :: (a -> b -> b) -> b -> UDouble a -> b # foldl :: (b -> a -> b) -> b -> UDouble a -> b # foldl' :: (b -> a -> b) -> b -> UDouble a -> b # foldr1 :: (a -> a -> a) -> UDouble a -> a # foldl1 :: (a -> a -> a) -> UDouble a -> a # elem :: Eq a => a -> UDouble a -> Bool # maximum :: Ord a => UDouble a -> a # minimum :: Ord a => UDouble a -> a # | |||||
| Traversable (UDouble :: Type -> Type) # | Since: base-4.9.0.0 | ||||
| Functor (URec Double :: Type -> Type) # | Since: base-4.9.0.0 | ||||
| Eq (URec Double p) # | Since: base-4.9.0.0 | ||||
| Ord (URec Double p) # | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.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 # | |||||
| Generic (URec Double p) # | |||||
Defined in GHC.Internal.Generics Associated Types
| |||||
| Show (URec Double p) # | Since: base-4.9.0.0 | ||||
| data URec Double (p :: k) # | Used for marking occurrences of Since: base-4.9.0.0 | ||||
| type Rep1 (URec Double :: k -> Type) # | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
| type Rep (URec Double p) # | Since: base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
Conversion
double2Int :: Double -> Int #
int2Double :: Int -> Double #
word2Double :: Word -> Double #
integerToDouble# :: Integer -> Double# #
Convert an Integer to a Double#
naturalToDouble# :: Natural -> Double# #
Encode a Natural (mantissa) into a Double#
rationalToDouble :: Integer -> Integer -> Double #
castWord64ToDouble :: Word64 -> Double #
does a bit-for-bit copy from an integral value
to a floating-point value.castWord64ToDouble w
Since: base-4.11.0.0
castDoubleToWord64 :: Double -> Word64 #
does a bit-for-bit copy from a floating-point value
to an integral value.castDoubleToWord64 f
Since: base-4.11.0.0
castWord64ToDouble# :: Word64# -> Double# #
Bitcast a Word64# into a Double#
castDoubleToWord64# :: Double# -> Word64# #
Bitcast a Double# into a Word64#
double2Float :: Double -> Float #
Operations
floorDouble :: Integral b => Double -> b #
ceilingDouble :: Integral b => Double -> b #
truncateDouble :: Integral b => Double -> b #
roundDouble :: Integral b => Double -> b #
properFractionDouble :: Integral b => Double -> (b, Double) #
Predicate
isDoubleDenormalized :: Double -> Int #
isDoubleFinite :: Double -> Int #
isDoubleInfinite :: Double -> Int #
isDoubleNaN :: Double -> Int #
isDoubleNegativeZero :: Double -> Int #
Comparison
Arithmetic
plusDouble :: Double -> Double -> Double #
minusDouble :: Double -> Double -> Double #
timesDouble :: Double -> Double -> Double #
divideDouble :: Double -> Double -> Double #
negateDouble :: Double -> Double #
expm1Double :: Double -> Double #
log1pDouble :: Double -> Double #
sqrtDouble :: Double -> Double #
fabsDouble :: 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 #
Formatting
showFloat :: RealFloat a => a -> ShowS #
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.
Constructors
| FFExponent | |
| FFFixed | |
| FFGeneric |
Operations
log1mexpOrd :: (Ord a, Floating a) => a -> a #
floatToDigits :: RealFloat a => Integer -> a -> ([Int], Int) #
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
n >= 1
x = 0.d1d2...dn * (base**e)
0 <= di <= base-1
integerToBinaryFloat' :: RealFloat a => Integer -> a #
Converts a positive integer to a floating-point value.
The value nearest to the argument will be returned. If there are two such values, the one with an even significand will be returned (i.e. IEEE roundTiesToEven).
The argument must be strictly positive, and floatRadix (undefined :: a) must be 2.
roundingMode# :: Integer -> Int# -> Int# #
Monomorphic equality operators
See GHC.Internal.Classes#matching_overloaded_methods_in_rules
Internal
These may vanish in a future release
Used to prevent exponent over/underflow when encoding floating point numbers. This is also the same as
\(x,y) -> max (-x) (min x y)
Example
>>>clamp (-10) 510
Since: base-4.13.0.0
powerDouble :: Double -> Double -> Double #
powerFloat :: Float -> Float -> Float #
stgDoubleToWord64 :: Double# -> Word64# #
Deprecated: Use castDoubleToWord64# instead
stgFloatToWord32 :: Float# -> Word32# #
Deprecated: Use castFloatToWord32# instead
stgWord64ToDouble :: Word64# -> Double# #
Deprecated: Use castWord64ToDouble# instead
stgWord32ToFloat :: Word32# -> Float# #
Deprecated: Use castWord32ToFloat# instead
Orphan instances
| Enum Double # |
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
Since: base-2.1 |
| Enum Float # |
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
Since: base-2.1 |
| Num Double # | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
Since: base-2.1 |
| Num Float # | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
Since: base-2.1 |
| Fractional Double # | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.
Since: base-2.1 |
| Fractional Float # | This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.
Since: base-2.1 |
| Real Double # | Beware that
Since: base-2.1 |
Methods toRational :: Double -> Rational # | |
| Real Float # | Beware that
Since: base-2.1 |
Methods toRational :: Float -> Rational # | |
| RealFrac Double # | Beware that results for non-finite arguments are garbage:
and get even more non-sensical if you ask for Since: base-2.1 |
| RealFrac Float # | Beware that results for non-finite arguments are garbage:
and get even more non-sensical if you ask for Since: base-2.1 |
| Show Double # | Since: base-2.1 |
| Show Float # | Since: base-2.1 |