Exact binary IEEE encodings and rational arithmetic for the four MIR float widths. No Lean/host Float is used. Finite rounding is nearest, ties to even, as used by pinned rustc_apfloat's default MIR operations.
- binary16 : FloatFormat
- binary32 : FloatFormat
- binary64 : FloatFormat
- binary128 : FloatFormat
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- f.fractionBits = f.width - f.exponentBits - 1
Instances For
Instances For
Equations
- f.minExponent = 1 - Int.ofNat f.bias
Instances For
Equations
- f.maxExponent = Int.ofNat f.bias
Instances For
Equations
- f.size = Miri.ABI.Size.ofBytes (UInt64.ofNat (f.width / 8))
Instances For
Equations
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- finite (numerator denominator : Nat) : FloatClass
- infinite : FloatClass
- nan (payload : Nat) : FloatClass
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Miri.Interpreter.instDecidableEqFloatClass.decEq (Miri.Interpreter.FloatClass.finite numerator denominator) Miri.Interpreter.FloatClass.infinite = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatClass.decEq (Miri.Interpreter.FloatClass.finite numerator denominator) (Miri.Interpreter.FloatClass.nan payload) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatClass.decEq Miri.Interpreter.FloatClass.infinite (Miri.Interpreter.FloatClass.finite numerator denominator) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatClass.decEq Miri.Interpreter.FloatClass.infinite Miri.Interpreter.FloatClass.infinite = isTrue ⋯
- Miri.Interpreter.instDecidableEqFloatClass.decEq Miri.Interpreter.FloatClass.infinite (Miri.Interpreter.FloatClass.nan payload) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatClass.decEq (Miri.Interpreter.FloatClass.nan payload) (Miri.Interpreter.FloatClass.finite numerator denominator) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatClass.decEq (Miri.Interpreter.FloatClass.nan payload) Miri.Interpreter.FloatClass.infinite = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatClass.decEq (Miri.Interpreter.FloatClass.nan a) (Miri.Interpreter.FloatClass.nan b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- encodingExceedsWidth : FloatError
- zeroDenominator : FloatError
- formatMismatch : FloatError
- invalidBinaryOperator (op : MIR.BinOp) : FloatError
- invalidIntegerWidth (width : Nat) : FloatError
- inconsistentRounding : FloatError
- invalidNaNChoice : FloatError
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.encodingExceedsWidth Miri.Interpreter.FloatError.encodingExceedsWidth = isTrue ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.encodingExceedsWidth (Miri.Interpreter.FloatError.invalidBinaryOperator op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.encodingExceedsWidth (Miri.Interpreter.FloatError.invalidIntegerWidth width) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.zeroDenominator Miri.Interpreter.FloatError.zeroDenominator = isTrue ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.zeroDenominator (Miri.Interpreter.FloatError.invalidBinaryOperator op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.zeroDenominator (Miri.Interpreter.FloatError.invalidIntegerWidth width) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.formatMismatch Miri.Interpreter.FloatError.formatMismatch = isTrue ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.formatMismatch (Miri.Interpreter.FloatError.invalidBinaryOperator op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.formatMismatch (Miri.Interpreter.FloatError.invalidIntegerWidth width) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidBinaryOperator op) Miri.Interpreter.FloatError.encodingExceedsWidth = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidBinaryOperator op) Miri.Interpreter.FloatError.zeroDenominator = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidBinaryOperator op) Miri.Interpreter.FloatError.formatMismatch = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidBinaryOperator op) (Miri.Interpreter.FloatError.invalidIntegerWidth width) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidBinaryOperator op) Miri.Interpreter.FloatError.inconsistentRounding = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidBinaryOperator op) Miri.Interpreter.FloatError.invalidNaNChoice = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidIntegerWidth width) Miri.Interpreter.FloatError.encodingExceedsWidth = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidIntegerWidth width) Miri.Interpreter.FloatError.zeroDenominator = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidIntegerWidth width) Miri.Interpreter.FloatError.formatMismatch = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidIntegerWidth width) (Miri.Interpreter.FloatError.invalidBinaryOperator op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidIntegerWidth width) Miri.Interpreter.FloatError.inconsistentRounding = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq (Miri.Interpreter.FloatError.invalidIntegerWidth width) Miri.Interpreter.FloatError.invalidNaNChoice = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.inconsistentRounding (Miri.Interpreter.FloatError.invalidBinaryOperator op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.inconsistentRounding (Miri.Interpreter.FloatError.invalidIntegerWidth width) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.inconsistentRounding Miri.Interpreter.FloatError.inconsistentRounding = isTrue ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.invalidNaNChoice (Miri.Interpreter.FloatError.invalidBinaryOperator op) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.invalidNaNChoice (Miri.Interpreter.FloatError.invalidIntegerWidth width) = isFalse ⋯
- Miri.Interpreter.instDecidableEqFloatError.decEq Miri.Interpreter.FloatError.invalidNaNChoice Miri.Interpreter.FloatError.invalidNaNChoice = isTrue ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- Miri.Interpreter.FloatBits.zero f negative = Miri.Interpreter.FloatBits.encode✝ f negative 0 0
Instances For
Equations
- Miri.Interpreter.FloatBits.infinity f negative = Miri.Interpreter.FloatBits.encode✝ f negative (2 ^ f.exponentBits - 1) 0
Instances For
Equations
- Miri.Interpreter.FloatBits.preferredNaN f = Miri.Interpreter.FloatBits.encode✝ f false (2 ^ f.exponentBits - 1) (2 ^ (f.fractionBits - 1))
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Round an exact nonnegative rational with a separate sign. Clamping the working exponent to MIN_EXP gives gradual subnormal underflow, including ties at signed zero. Overflow after rounding produces infinity.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Cast finite values with correct rounding. NaN payload conversion first quiets, shifts to the target precision, and forces the target quiet bit, as pinned ieee.rs::convert_r does. Miri's adjust_nan is applied separately.
Equations
- One or more equations did not get rendered due to their size.
Instances For
All outcomes generated by pinned Miri operator.rs::generate_nan. Sign choice is independent of candidate choice. A fixed seed is not a safety model.
Equations
- One or more equations did not get rendered due to their size.
Instances For
MIR arithmetic's base result. NaN payload/sign selection is subsequently performed by nanChoices/adjust_nan; finite arithmetic never calls a host float.
Equations
- One or more equations did not get rendered due to their size.
Instances For
IEEE partial ordering: both signs of zero compare equal; all NaNs are unordered. Infinities are ordered without rational approximation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Miri.Interpreter.FloatBits.fromInteger format value = Miri.Interpreter.FloatBits.roundRatio format (decide (value < 0)) value.natAbs 1
Instances For
Rust as float-to-int conversion saturates and truncates toward zero;
NaNs map to zero. Width and signedness are from the target compiler layout.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every exact zero retains its input sign under nearest-even conversion.
Saturating integer casts of any decoded NaN are exactly zero.