Lua "inrange"

What’s the syntax for in range in Lua?

You can define this simple function:


function math.inrange(val, min, max)
    return val <= max and val >= min
end

And, optionally:


function math.inrangeExclusive(val, min, max)
    return val < max and val > min
end