NLA-lib Explorer

Float.Model.UnpackedFloat.toReal_roundWithAccuracy_exact

Library · theorem

An exact positive integral mantissa already at its target exponent rounds without error.

Float.Model.UnpackedFloat.toReal_roundWithAccuracy_exact (spec : Float.Model.Format)
  (s : Float.Model.UnpackedFloat.Sign) (m : ℕ) (e : ℤ) (hm : 0 < m)
  (he : e = spec.targetExponent (Float.Model.totalExponent m e)) :
  (Float.Model.UnpackedFloat.roundWithAccuracy spec s m e
        Float.Model.UnpackedFloat.Accuracy.exact).toReal =
    s.toReal * (↑m * 2 ^ e)

Full source on GitHub

Import NLAlib.ForMathlib.Data.Float.Rounding.