Some info about min() and max()
Hey, guys! I couldn't find an info around the internet about these two natives. So, I know what they both should return, but the problem is that I don't know which one which value returns. I mean, does max(5+1, 5) will return 5, or it will return 6. And does max(4, 5) return 5 or 4? The same about min().
I found they are just natives from the core.inc, but no info. Just that, thanks in advance! |
Re: Some info about min() and max()
min will return whatever value is the lowest
max will return whatever value is the highest |
Re: Some info about min() and max()
Understood it. I made this thread, because I wanted to understand if I can use these natives as one-side clamp() function. The answer is yes. Thanks for the info!
What can I explain shortly: You can use max() to make a border, which a value can't go lower. Like if you want your value to not get under the zero, you make it like: PHP Code:
PHP Code:
Thanks for the info! |
Re: Some info about min() and max()
min returns the parameter with the lower value.
max returns the parameter with the higher value. |
Re: Some info about min() and max()
Yeah, I got it. Just explained what I could understand to someone else, who searches for such an info. These two replies may be deleted, I think.
|
Re: Some info about min() and max()
Quote:
|
| All times are GMT -4. The time now is 13:00. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.