Expand description
Small shared numeric helpers.
These consolidate copy-pasted implementations that had identical
semantics. Where existing local copies differ subtly (e.g. returning 0.0
rather than NAN for degenerate input, or computing a lower median instead
of averaging the two central values) they are intentionally left in place —
see the Phase-3b dedup notes.