If you looked at that, 2,000,000,000 is within the range of an int.
We select the smallest value. The first argument expression is
computed as a long, so we shouldn't ever overflow and cause the
first argument to be negative. If the first argument is larger
than 2 billion, then it does risk overflow, but the 2nd argument
is smaller, so it is returned.
The code is fine as is.