[#mp_units-clamp_non_negative]
= xref:mp_units.adoc[mp&lowbar;units]::clamp&lowbar;non&lowbar;negative
:relfileprefix: ../
:mrdocs:

Policy that clamps the value to &lsqb;0, ∞)&period;&rsqb;

== Synopsis

Declared in `&lt;mp&hyphen;units&sol;overflow&lowbar;policies&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct clamp&lowbar;non&lowbar;negative;
----

== Description

Saturates negative values to zero&period; Use when small negative values can arise from floating&hyphen;point rounding in a naturally non&hyphen;negative domain (e&period;g&period;, a computed energy that rounds to −1e−15 J should be treated as 0 J rather than signalling an error)&period;

== 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]#
