Rounding modes used in floating-point calculations.
Available modes:
RNA
: Round to nearest, tiebreak away from zero.RNE
: Round to nearest, tiebreak to even significand.RTN
: Round towards negative infinity.RTP
: Round towards positive infinity.RTZ
: Round towards zero.
- RNA : RoundingMode
- RNE : RoundingMode
- RTN : RoundingMode
- RTP : RoundingMode
- RTZ : RoundingMode
Instances For
Equations
- One or more equations did not get rendered due to their size.
Find the position of the last (most significant) set bit in a BitVec.
Returns zero if BitVec is zero. Otherwise, returns the index starting from 1.
This implements the same function as negfixed
, but with $O(\log n)$
steps instead.
Instances For
Equations
- shouldRoundAway RoundingMode.RNE sign odd v = decide (v.msb = true ∧ (BitVec.truncate (n - 1) v ≠ 0 ∨ odd = true))
- shouldRoundAway RoundingMode.RNA sign odd v = v.msb
- shouldRoundAway RoundingMode.RTP sign odd v = decide ((v.msb = true ∨ BitVec.truncate (n - 1) v ≠ 0) ∧ ¬sign = true)
- shouldRoundAway RoundingMode.RTN sign odd v = decide ((v.msb = true ∨ BitVec.truncate (n - 1) v ≠ 0) ∧ sign = true)
- shouldRoundAway RoundingMode.RTZ sign odd v = decide False
Instances For
def
round
{width exOffset : Nat}
(exWidth sigWidth : Nat)
(mode : RoundingMode)
(x : EFixedPoint width exOffset)
:
PackedFloat exWidth sigWidth
Round an extended fixed-point number to its nearest floating point number of the specified format, with the specified rounding mode.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Determine if a fixed-point number has an exact representation in the specified floating-point format.
Equations
- One or more equations did not get rendered due to their size.