Just a little mathematic question
Posted: Wed Mar 28, 2012 11:23 am
So, is there a simpler way to check if value is between two values than:
Where 'value' is the changing value and - 10 and 10 are the limits which I want to check it being in between of.
I'm trying to find a shorter way to write it but I can't come up with anything.
I think there must be some easy solution which I just can't figure out right now.
Thanks in advance! =)
- Code: Select all
if (value >= -10 && value <= 10)
Where 'value' is the changing value and - 10 and 10 are the limits which I want to check it being in between of.
I'm trying to find a shorter way to write it but I can't come up with anything.
I think there must be some easy solution which I just can't figure out right now.
Thanks in advance! =)