20 lines
858 B
Plaintext
Raw Normal View History

2013-05-14 14:51:19 +10:00
<h3>clamp() function</h3>
Restricts an input value to a specified range.
<p><h4>Syntax</h4>
clamp(<i>minimum</i>,<i>input</i>,<i>maximum</i>)</p>
<p><h4>Arguments</h4>
<!-- List args for functions here-->
<i> minimum</i> &rarr; The smallest value <i>input</i> is allowed to take.<br>
<i> input</i> &rarr; a value which will be restricted to the range specified by <i>minimum</i> and <i>maximum</i>.<br>
<i> maximum</i> &rarr; The largest value <i>input</i> is allowed to take.<br>
<h4>Example</h4>
<!-- Show example of function.-->
clamp(1,5,10) &rarr; 5 (<i>input</i> is between 1 and 10 so is returned unchanged)<br>
clamp(1,0,10) &rarr; 1 (<i>input</i> is less than minimum value of 1, so function returns 1)<br>
clamp(1,11,10) &rarr; 10 (<i>input</i> is greater than maximum value of 10, so function returns 11)<br>