Clamp the output properly instead of setting it to zero if the value is out of range.
Clamp the output properly instead of setting it to zero if the value is out of range.