HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleAgda-2.7.0.1Haskell2010

Agda.Utils.Float

Logically consistent comparison of floating point numbers.

  • 43 values
  • PackageAgda-2.7.0.1
  • Exports43
  • LanguageHaskell2010
  • LicenceMIT
  • SourceFloat.hs
valuedoubleDenotEq :: Double -> Double -> Bool
#

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 its mantissa and its exponent, normalised such that the mantissa is the smallest possible number without loss of accuracy.