Skip to main content

values_equal

Function values_equal 

Source
pub fn values_equal(left: &RuntimeValue, right: &RuntimeValue) -> bool
Expand description

Value equality for the equals/== operator, set/list membership, and map keys (RuntimeValue’s PartialEq delegates here — ONE equality).

  • Floats compare by IEEE == (NaN != NaN, -0.0 == 0.0) — identical to what compiled Rust emits, on every engine.
  • Cross-type numeric equality is EXACT (mathematical value, never a lossy cast): 1 == 1.0, but 9007199254740993 != 9007199254740993.0 because that float literal IS 2^53. Coheres with compare and with the unified numeric hash (base::numeric).
  • Collections, tuples, and structs compare STRUCTURALLY (same shape, all parts equal), with an Rc identity fast path and a depth cap against cyclic values.
  • Decimal/Complex/Modular keep their documented within-type equality (they have no cross-type ordering, so there is no coherence to break).