MCPcopy Create free account
hub / github.com/antlr/codebuff / saturatedSubtract

Method saturatedSubtract

output/java_guava/1.4.18/IntMath.java:571–574  ·  view source on GitHub ↗

Returns the difference 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)

Source from the content-addressed store, hash-verified

569 */
570
571 @Beta
572 public static int saturatedSubtract(int a, int b) {
573 return Ints.saturatedCast((long) a - b);
574 }
575
576 /**
577 * Returns the product of {@code a} and {@code b} unless it would overflow or underflow in which

Callers

nothing calls this directly

Calls 1

saturatedCastMethod · 0.95

Tested by

no test coverage detected