- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for checkedAdd (0.03 sec)
-
android/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java
public boolean noAddOverflow(int a, int b) { try { int unused = IntMath.checkedAdd(a, b); return true; } catch (ArithmeticException e) { return false; } } @Override public boolean noAddOverflow(long a, long b) { try { long unused = LongMath.checkedAdd(a, b); return true; } catch (ArithmeticException e) {
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Mon Jul 14 14:44:08 UTC 2025 - 6.9K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/LongMathTest.java
boolean expectedSuccess = fitsInLong(expectedResult); try { assertEquals(a + b, LongMath.checkedAdd(a, b)); assertTrue(expectedSuccess); } catch (ArithmeticException e) { if (expectedSuccess) { failFormat( "expected checkedAdd(%s, %s) = %s; got ArithmeticException", a, b, expectedResult); } } } } }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Mon Aug 11 19:31:30 UTC 2025 - 31.4K bytes - Viewed (0) -
android/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 Sep 05 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 Sep 05 12:43:10 UTC 2025 - Last Modified: Fri Aug 29 16:20:07 UTC 2025 - 46.8K bytes - Viewed (0)