Skip to main content

float_bounds

Function float_bounds 

Source
fn float_bounds<F: Float>(lower: F, upper: F) -> Option<(F, F)>
Expand description

Persist computes float column bounds in IEEE-754 total order, in which negative NaNs sort below -Infinity. Datum floats compare via OrderedFloat, which ranks every NaN (of either sign) above every other value. A lower bound that is a negative NaN therefore admits both NaNs (the largest values under Datum ordering) and ordinary values up to upper, a set no Datum interval can bound, so no bounds are returned and the column is treated as unconstrained. The one exception is an upper bound that is also a negative NaN, which under total order means every value in the column is a NaN.

NOTE: the widening ResultSpec::value_between does for inverted bounds is not sufficient here. A part holding both -NaN and +NaN decodes to the non-inverted bounds (NaN, NaN), which would wrongly claim the part holds nothing but NaN. Only this layer still sees the NaN signs.