hasSameEncoding method

bool hasSameEncoding(
  1. FloatingPointValue other
)

Whether this and other have identical formats and bit encodings.

Unlike numerical equality, this can be used to compare NaN payloads, signaling bits, and signed zeros in tests.

Implementation

bool hasSameEncoding(FloatingPointValue other) =>
    exponentWidth == other.exponentWidth &&
    mantissaWidth == other.mantissaWidth &&
    explicitJBit == other.explicitJBit &&
    subNormalAsZero == other.subNormalAsZero &&
    sign == other.sign &&
    exponent == other.exponent &&
    mantissa == other.mantissa;