Returns the product of a and b unless it would overflow or underflow in which case Integer.MAX_VALUE or Integer.MIN_VALUE is returned, respectively. @since 20.0
(int a, int b)
| 581 | */ |
| 582 | |
| 583 | @Beta |
| 584 | public static int saturatedMultiply(int a, int b) { |
| 585 | return Ints.saturatedCast((long) a * b); |
| 586 | } |
| 587 | |
| 588 | /** |
| 589 | * Returns the {@code b} to the {@code k}th power, unless it would overflow or underflow in which |
no test coverage detected