Skip to main content

lower_bound_present

Function lower_bound_present 

Source
pub fn lower_bound_present(lo: Number) -> bool
Expand description

Is this lower bound a real bound, or the absent-bound sentinel?

The sentinel convention is directional, and reading it as a magnitude is a bug this codebase has now hit four separate times (#396, #398, #401, #402). A lower bound is absent only at or below NLP_LOWER_BOUND_INF; -5e20 is an ordinary finite lower bound, not “beyond infinity”, and a symmetric |b| < 1e19 test silently discards it.

Pair with upper_bound_present and decide presence before comparing a pair: lo > hi means nothing until both sides are known to be real, and neither does lo == hi (an “equality” at the sentinel is a one-sided row).

Callers that override the thresholds via nlp_lower_bound_inf / nlp_upper_bound_inf must test against their own values instead — these helpers hard-code the defaults.