- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for checkedAdd (0.04 sec)
-
guava-tests/test/com/google/common/math/IntMathTest.java
for (int b : ALL_INTEGER_CANDIDATES) { BigInteger expectedResult = valueOf(a).add(valueOf(b)); boolean expectedSuccess = fitsInInt(expectedResult); try { assertEquals(a + b, IntMath.checkedAdd(a, b)); assertTrue(expectedSuccess); } catch (ArithmeticException e) { assertFalse(expectedSuccess); } } } } @AndroidIncompatible // slow
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Mon Aug 11 19:31:30 UTC 2025 - 24.1K bytes - Viewed (0) -
guava/src/com/google/common/math/LongMath.java
* * @throws ArithmeticException if {@code a + b} overflows in signed {@code long} arithmetic */ @InlineMe(replacement = "Math.addExact(a, b)") public static long checkedAdd(long a, long b) { return Math.addExact(a, b); } /** * Returns the difference of {@code a} and {@code b}, provided it does not overflow. *Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Mon Nov 03 21:01:09 UTC 2025 - 46.8K bytes - Viewed (0)