[#mp_units-clamp_non_negative] = xref:mp_units.adoc[mp_units]::clamp_non_negative :relfileprefix: ../ :mrdocs: Policy that clamps the value to [0, āˆž).] == Synopsis Declared in `<mp‐units/overflow_policies.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct clamp_non_negative; ---- == Description Saturates negative values to zero. Use when small negative values can arise from floating‐point rounding in a naturally non‐negative domain (e.g., a computed energy that rounds to āˆ’1eāˆ’15 J should be treated as 0 J rather than signalling an error). == Member Functions [cols="1,4"] |=== | Name| Description | xref:mp_units/clamp_non_negative/operator_call.adoc[`operator()`] | Clamps `v` to zero if it is negative. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:mp_units/clamp_non_negative/min.adoc[`min`] | Lower domain bound: zero in any unit. See check_non_negative::min for rationale. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#