clamp ![frozen](https://camo.githubusercontent.com/7e79fa10cbaf7640257b89b7b5b70b3c5c88b2a659bb2c6138ec105335bdf172/687474703a2f2f68756768736b2e6769746875622e696f2f73746162696c6974792d6261646765732f646973742f66726f7a656e2e737667)
Clamp a value between two other values. It's as simple as modules come - saving keystrokes because I've had to write this function too many times.
Usage
clamp(value, a, b)
Returns value
, if it is between a
and b
. Otherwise, returns the number it's gone past.
License
MIT. See LICENSE.md for details.