MCPcopy Create free account
hub / github.com/MenoData/Time4J / safeNegate

Method safeNegate

base/src/main/java/net/time4j/base/MathUtils.java:339–347  ·  view source on GitHub ↗
(int value)

Source from the content-addressed store, hash-verified

337 * @throws ArithmeticException if int-range overflows
338 */
339 public static int safeNegate(int value) {
340
341 if (value == Integer.MIN_VALUE) {
342 throw new ArithmeticException("Not negatable: " + value);
343 } else {
344 return -value;
345 }
346
347 }
348
349 /**
350 * <p>Inverts the number with range check. </p>

Callers 15

formatMethod · 0.95
convertMethod · 0.95
convertMethod · 0.95
formatYearMethod · 0.95
ofMethod · 0.95
plusMethod · 0.95
withMethod · 0.95
mergeMethod · 0.95
summarizeMethod · 0.95
minusMethod · 0.95
minusMethod · 0.95
addMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected