Safe Haskell | Safe |
---|
Synopsis
- doubleEq :: Double -> Double -> Bool
- doubleLe :: Double -> Double -> Bool
- doubleLt :: Double -> Double -> Bool
- truncateDouble :: Double -> Double
- intToDouble :: Integral a => a -> Double
- doublePlus :: Double -> Double -> Double
- doubleMinus :: Double -> Double -> Double
- doubleTimes :: Double -> Double -> Double
- doubleNegate :: Double -> Double
- doubleDiv :: Double -> Double -> Double
- doublePow :: Double -> Double -> Double
- doubleSqrt :: Double -> Double
- doubleExp :: Double -> Double
- doubleLog :: Double -> Double
- doubleSin :: Double -> Double
- doubleCos :: Double -> Double
- doubleTan :: Double -> Double
- doubleASin :: Double -> Double
- doubleACos :: Double -> Double
- doubleATan :: Double -> Double
- doubleATan2 :: Double -> Double -> Double
- doubleSinh :: Double -> Double
- doubleCosh :: Double -> Double
- doubleTanh :: Double -> Double
- doubleASinh :: Double -> Double
- doubleACosh :: Double -> Double
- doubleATanh :: Double -> Double
- negativeZero :: Double
- positiveInfinity :: Double
- negativeInfinity :: Double
- nan :: Double
- isPosInf :: Double -> Bool
- isNegInf :: Double -> Bool
- isPosZero :: Double -> Bool
- isNegZero :: Double -> Bool
- doubleRound :: Double -> Maybe Integer
- doubleFloor :: Double -> Maybe Integer
- doubleCeiling :: Double -> Maybe Integer
- normaliseNaN :: Double -> Double
- doubleToWord64 :: Double -> Word64
- doubleDenotEq :: Double -> Double -> Bool
- doubleDenotOrd :: Double -> Double -> Ordering
- asFinite :: Double -> Maybe Double
- doubleToRatio :: Double -> (Integer, Integer)
- ratioToDouble :: Integer -> Integer -> Double
- doubleDecode :: Double -> Maybe (Integer, Integer)
- isSafeInteger :: Double -> Bool
- doubleRadix :: Integer
- doubleDigits :: Int
- doubleRange :: (Int, Int)
- minMantissa :: Integer
- maxMantissa :: Integer
- minExponent :: Integer
- maxExponent :: Integer
- doubleEncode :: Integer -> Integer -> Maybe Double
Documentation
truncateDouble :: Double -> Double Source #
intToDouble :: Integral a => a -> Double Source #
doublePlus :: Double -> Double -> Double Source #
doubleMinus :: Double -> Double -> Double Source #
doubleTimes :: Double -> Double -> Double Source #
doubleNegate :: Double -> Double Source #
doubleSqrt :: Double -> Double Source #
doubleASin :: Double -> Double Source #
doubleACos :: Double -> Double Source #
doubleATan :: Double -> Double Source #
doubleATan2 :: Double -> Double -> Double Source #
doubleSinh :: Double -> Double Source #
doubleCosh :: Double -> Double Source #
doubleTanh :: Double -> Double Source #
doubleASinh :: Double -> Double Source #
doubleACosh :: Double -> Double Source #
doubleATanh :: Double -> Double Source #
negativeZero :: Double Source #
positiveInfinity :: Double Source #
negativeInfinity :: Double Source #
doubleRound :: Double -> Maybe Integer Source #
doubleFloor :: Double -> Maybe Integer Source #
doubleCeiling :: Double -> Maybe Integer Source #
normaliseNaN :: Double -> Double Source #
doubleToWord64 :: Double -> Word64 Source #
doubleDenotEq :: Double -> Double -> Bool Source #
Denotational equality for floating point numbers, checks bitwise equality.
NOTE: Denotational equality distinguishes NaNs, so its results may vary depending on the architecture and compilation flags. Unfortunately, this is a problem with floating-point numbers in general.
doubleDenotOrd :: Double -> Double -> Ordering Source #
I guess "denotational orderings" are now a thing? The point is that we need an Ord instance which provides a total ordering, and is consistent with the denotational equality.
NOTE: The ordering induced via doubleToWord64
is total, and is consistent
with doubleDenotEq
. However, it is *deeply* unintuitive. For one, it
considers all negative numbers to be larger than positive numbers.
asFinite :: Double -> Maybe Double Source #
Return Just x if it's a finite number, otherwise return Nothing.
doubleToRatio :: Double -> (Integer, Integer) Source #
Decode a Double to an integer ratio.
ratioToDouble :: Integer -> Integer -> Double Source #
Encode an integer ratio as a double.
doubleDecode :: Double -> Maybe (Integer, Integer) Source #
Decode a Double to its mantissa and its exponent, normalised such that the mantissa is the smallest possible number without loss of accuracy.
isSafeInteger :: Double -> Bool Source #
Checks whether or not the Double is within a safe range of operation.
doubleRadix :: Integer Source #
doubleDigits :: Int Source #
doubleRange :: (Int, Int) Source #
minMantissa :: Integer Source #
The smallest representable mantissa. Simultaneously, the smallest integer which can be represented as a Double without loss of precision.
maxMantissa :: Integer Source #
The largest representable mantissa. Simultaneously, the largest integer which can be represented as a Double without loss of precision.
minExponent :: Integer Source #
The largest representable exponent.
maxExponent :: Integer Source #
The smallest representable exponent.
doubleEncode :: Integer -> Integer -> Maybe Double Source #
Encode a mantissa and an exponent as a Double.