NLA-lib Explorer

Float.Model.UnpackedFloat.isNearestFloat_toReal_round

Library · theorem

Exact inputs at an exponent ≥ minExponent round to a nearest float of the format.

Float.Model.UnpackedFloat.isNearestFloat_toReal_round {spec : Float.Model.Format}
  (s : Float.Model.UnpackedFloat.Sign) (m : ℕ) (e : ℤ) (hm : 0 < m) (he : spec.minExponent ≤ e) :
  Float.Model.BinaryRounding.IsNearestFloat spec.mantissaBits spec.minExponent
    (s.toReal * (↑m * 2 ^ e)) (Float.Model.UnpackedFloat.round spec s m e).toReal

Full source on GitHub

Import NLAlib.ForMathlib.Data.Float.Operations.