get the maximum between two numbers.

this function is faster than Math.max as it uses the ternary conditional operator, which makes it highly JIT optimized.