TorchLean API

FloatLib.Floats.Formats.DecimalInterchange.Conversion.Binary.SpecialProof

Binary conversion of zeros and NaNs #

The zero theorem covers every status flag. The NaN field theorems give the stored sign, the all-ones exponent and the quiet-bit-plus-payload fraction for every destination width.

@[simp]

Zero magnitude cannot overflow in any rounding direction.

@[simp]
theorem FloatLib.Floats.Formats.DecimalInterchange.Conversion.toBinary_zero (fmt : BinaryInterchange.FloatFormat) (hfmt : fmt.isIEEE = true) (mode : RoundingMode) (s : Bool) (q : ℤ) :
toBinary fmt hfmt mode (Datum.finite s 0 q) = { value := BinaryInterchange.Model.zero fmt s, status := { }, ternary := Ordering.eq }

Every decimal zero cohort converts to the binary zero of the same sign, with clear status.

@[simp]

NaN conversion preserves the sign bit for every destination width.

@[simp]

The encoded NaN exponent is all ones.

@[simp]

The quiet bit is set and the remaining fraction bits contain the selected payload.

@[simp]

The binary NaN constructed by conversion is classified as NaN on IEEE destinations.

The highest fraction bit is one, so the constructed NaN is quiet.