Returns the absolute value of an {@code int} value. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned.
Returns the absolute value of a {@code long} value. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned.
Returns the absolute value of a {@code float} value. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned. Special cases: <ul><li>If the argument is positive zero or negative zero, the result is positive zero. <li>If the argument is infinite, the result is positive infinity. <li>If the argument is NaN, the result is NaN.</ul>
Returns the absolute value of a {@code double} value. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned. Special cases: <ul><li>If the argument is positive zero or negative zero, the result is positive zero. <li>If the argument is infinite, the result is positive infinity. <li>If the argument is NaN, the result is NaN.</ul>
Returns the sum of its arguments, throwing an exception if the result overflows an {@code int}.
Returns the sum of its arguments, throwing an exception if the result overflows a {@code long}.
Returns the smallest (closest to negative infinity) {@code double} value that is greater than or equal to the argument and is equal to a mathematical integer. Special cases: <ul><li>If the argument value is already equal to a mathematical integer, then the result is the same as the argument. <li>If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the argument. <li>If the argument value is less than zero but greater than -1.0, then the result is negative zero.</ul> Note that the value of {@code Math.ceil(x)} is exactly the value of {@code -Math.floor(-x)}.
Returns the argument decremented by one, throwing an exception if the result overflows an {@code int}.
Returns the argument decremented by one, throwing an exception if the result overflows a {@code long}.
Returns the largest (closest to positive infinity) {@code double} value that is less than or equal to the argument and is equal to a mathematical integer. Special cases: <ul><li>If the argument value is already equal to a mathematical integer, then the result is the same as the argument. <li>If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the argument.</ul>
Returns the largest (closest to positive infinity) {@code int} value that is less than or equal to the algebraic quotient. There is one special case, if the dividend is the {@linkplain Integer#MIN_VALUE Integer.MIN_VALUE} and the divisor is {@code -1}, then integer overflow occurs and the result is equal to {@code Integer.MIN_VALUE}. <p> Normal integer division operates under the round to zero rounding mode (truncation). This operation instead acts under the round toward negative infinity (floor) rounding mode. The floor rounding mode gives different results from truncation when the exact result is negative. <ul> <li>If the signs of the arguments are the same, the results of {@code floorDiv} and the {@code /} operator are the same. <br> For example, {@code floorDiv(4, 3) == 1} and {@code (4 / 3) == 1}.</li> <li>If the signs of the arguments are different, the quotient is negative and {@code floorDiv} returns the integer less than or equal to the quotient and the {@code /} operator returns the integer closest to zero.<br> For example, {@code floorDiv(-4, 3) == -2}, whereas {@code (-4 / 3) == -1}. </li> </ul>
Returns the largest (closest to positive infinity) {@code long} value that is less than or equal to the algebraic quotient. There is one special case, if the dividend is the {@linkplain Long#MIN_VALUE Long.MIN_VALUE} and the divisor is {@code -1}, then integer overflow occurs and the result is equal to {@code Long.MIN_VALUE}. <p> Normal integer division operates under the round to zero rounding mode (truncation). This operation instead acts under the round toward negative infinity (floor) rounding mode. The floor rounding mode gives different results from truncation when the exact result is negative. <p> For examples, see {@link #floorDiv(int, int)}.
Returns the largest (closest to positive infinity) {@code long} value that is less than or equal to the algebraic quotient. There is one special case, if the dividend is the {@linkplain Long#MIN_VALUE Long.MIN_VALUE} and the divisor is {@code -1}, then integer overflow occurs and the result is equal to {@code Long.MIN_VALUE}. <p> Normal integer division operates under the round to zero rounding mode (truncation). This operation instead acts under the round toward negative infinity (floor) rounding mode. The floor rounding mode gives different results from truncation when the exact result is negative. <p> For examples, see {@link #floorDiv(int, int)}.
Returns the floor modulus of the {@code int} arguments. <p> The floor modulus is {@code x - (floorDiv(x, y) * y)}, has the same sign as the divisor {@code y}, and is in the range of {@code -abs(y) < r < +abs(y)}.
Returns the floor modulus of the {@code long} and {@code int} arguments. <p> The floor modulus is {@code x - (floorDiv(x, y) * y)}, has the same sign as the divisor {@code y}, and is in the range of {@code -abs(y) < r < +abs(y)}.
Returns the floor modulus of the {@code long} arguments. <p> The floor modulus is {@code x - (floorDiv(x, y) * y)}, has the same sign as the divisor {@code y}, and is in the range of {@code -abs(y) < r < +abs(y)}.
Returns the argument incremented by one, throwing an exception if the result overflows an {@code int}.
Returns the argument incremented by one, throwing an exception if the result overflows a {@code long}.
Returns the greater of two {@code int} values. That is, the result is the argument closer to the value of {@link Integer#MAX_VALUE}. If the arguments have the same value, the result is that same value.
Returns the greater of two {@code long} values. That is, the result is the argument closer to the value of {@link Long#MAX_VALUE}. If the arguments have the same value, the result is that same value.
Returns the greater of two {@code float} values. That is, the result is the argument closer to positive infinity. If the arguments have the same value, the result is that same value. If either value is NaN, then the result is NaN. Unlike the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero. If one argument is positive zero and the other negative zero, the result is positive zero.
Returns the greater of two {@code double} values. That is, the result is the argument closer to positive infinity. If the arguments have the same value, the result is that same value. If either value is NaN, then the result is NaN. Unlike the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero. If one argument is positive zero and the other negative zero, the result is positive zero.
Returns the smaller of two {@code int} values. That is, the result the argument closer to the value of {@link Integer#MIN_VALUE}. If the arguments have the same value, the result is that same value.
Returns the smaller of two {@code long} values. That is, the result is the argument closer to the value of {@link Long#MIN_VALUE}. If the arguments have the same value, the result is that same value.
Returns the product of the arguments, throwing an exception if the result overflows an {@code int}.
Returns the product of the arguments, throwing an exception if the result overflows a {@code long}.
Returns the product of the arguments, throwing an exception if the result overflows a {@code long}.
Returns the exact mathematical product of the arguments.
Returns as a {@code long} the most significant 64 bits of the 128-bit product of two 64-bit factors.
Returns the negation of the argument, throwing an exception if the result overflows an {@code int}.
Returns the negation of the argument, throwing an exception if the result overflows a {@code long}.
Returns the difference of the arguments, throwing an exception if the result overflows an {@code int}.
Returns the difference of the arguments, throwing an exception if the result overflows a {@code long}.
Returns the value of the {@code long} argument; throwing an exception if the value overflows an {@code int}.