minimum between two numbers. this is faster than Math.min as it uses the ternary conditional operator, which makes it highly JIT optimized.