Return Just x if it's a finite number, otherwise return Nothing.
ModuleAgda-2.8.0.2Haskell2010
Agda.Utils.Float
Logically consistent comparison of floating point numbers.
Synopsis
- value asFinite
- value isPosInf
- value isNegInf
- value isPosZero
- value isNegZero
- value isSafeInteger
- value doubleEq
- value doubleLe
- value doubleLt
- value intToDouble
- value doublePlus
- value doubleMinus
- value doubleTimes
- value doubleNegate
- value doubleDiv
- value doublePow
- value doubleSqrt
- value doubleExp
- value doubleLog
- value doubleSin
- value doubleCos
- value doubleTan
- value doubleASin
- value doubleACos
- value doubleATan
- value doubleATan2
- value doubleSinh
- value doubleCosh
- value doubleTanh
- value doubleASinh
- value doubleACosh
- value doubleATanh
- value doubleRound
- value doubleFloor
- value doubleCeiling
- value doubleDenotEq
- value doubleDenotOrd
- value doubleToWord64
- value doubleToRatio
- value ratioToDouble
- value doubleDecode
- value doubleEncode
- value toStringWithoutDotZero
- PackageAgda-2.8.0.2
- Exports43
- LanguageHaskell2010
- LicenceMIT
- SourceFloat.hs
Checks whether or not the Double is within a safe range of operation.
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.
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.
Decode a Double to an integer ratio.
Encode an integer ratio as a double.
Decode a Double to its mantissa and its exponent, normalised such that the mantissa is the smallest possible number without loss of accuracy.
Encode a mantissa and an exponent as a Double.
Remove suffix .0 from printed floating point number.