Expand description
Shared numeric helpers: percentage clamping, sum checks, thresholds.
Functions§
- percentage_
in_ range - Whether
pctis a valid percentage value: finite and in[0.0, 100.0]. - sums_to
- Whether the values yielded by
valuessum totargetwithin± tolerance(percentage points). Returns the computed sum alongside the verdict, since callers reporting a failure need it in their message. A non-finite sum (e.g. one input was NaN) is alwaysfalse.