Method ClampToZero
ClampToZero(double)
Clamps the specified value to zero if it is less than zero.
public static double ClampToZero(double value)
Parameters
valuedoubleThe value to clamp. If the value is negative, it will be clamped to zero; otherwise, the original value is returned.
Returns
- double
The original value if it is zero or positive; otherwise, zero.
ClampToZero(float)
Clamps the specified value to zero if it is less than zero.
public static float ClampToZero(float value)
Parameters
valuefloatThe value to clamp. If the value is negative, it will be clamped to zero; otherwise, the original value is returned.
Returns
- float
The original value if it is zero or positive; otherwise, zero.