Clamp
Hi, could you explain a bit more and give an example ?
"Clamp ensures that a variable stays within 2 threshold values" PHP Code:
|
Re: Clamp
with this exemple : clamp(MyValue,0,10)
If 'MyValue' < 0, it will return 0. If 'MyValue' > 10, it will return 10 Otherwise, it will return 'MyValue'. |
Re: Clamp
Think of it as only allowing a number returned to be within the two values (min,max) entered. If the number entered exceeds the min or max, the relative min or max value is returned.
clamp( your number, min allowed , max allowed ) clamp( -55 , 0 , 10 ) = 0 clamp( 34 , 0 , 25 ) = 25 |
Re: Clamp
|
Re: Clamp
Thanks, i understand now :D
|
| All times are GMT -4. The time now is 05:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.