[#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] |=== | Name | xref:mp_units/clamp_non_negative/operator_call.adoc[`operator()`] |=== == Data Members [cols=1] |=== | Name | xref:mp_units/clamp_non_negative/min.adoc[`min`] |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#