pub enum NumericComparisonPolicy {
Exact,
Approximate,
}Expand description
Selects exact or floating-projection numeric comparison.
Self::Exact provides deterministic mathematical ordering across numeric
representations. Self::Approximate performs a pair-dependent projection
and is not transitive, so it must not be used to implement Ord, sort or
group values, or construct keys for ordered maps and sets.
This enum intentionally defines a closed policy set. Exhaustive matching is part of its API contract; adding a variant is a deliberate breaking change.
§Examples
use qubit_datatype::NumericComparisonPolicy;
assert_eq!(NumericComparisonPolicy::default(), NumericComparisonPolicy::Exact);Variants§
Exact
Preserves exact mathematical values for deterministic ordering.
Approximate
Attempts finite f64 projection when a primitive float participates.
Primitive infinities are ordered separately. If either operand cannot
be projected to a finite f64, comparison falls back to the exact path.
Projected comparison is not transitive across mixed representations and
is therefore unsuitable for Ord, sorting, grouping, or ordered keys.