views:

68

answers:

2

Does Actionscript have a built-in function that accepts a number and can return a Boolean if this number is between 2 numbers.

For example

3 is between 2 and 6   //returns true
5 is between 10 and 20 //returns false
+4  A: 
Michael Aaron Safyan
+1, "simply using the boolean expression is much more readable"
Sam
Thanks. Was just wondering if it already exists.
davi
A: 

function calls are pretty slow, so I would stay away from this if you can at all avoid it.

It's not that hard to write: if (x > low && x < high)

Daniel Hai