- Sort Score
- Num 10 results
- Language All
Results 1 - 7 of 7 for checkedAdd (0.11 seconds)
-
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); } } } } }
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Oct 30 14:15:36 GMT 2025 - 31.4K bytes - Click Count (0) -
android/guava/src/com/google/common/math/IntMath.java
* Math#addExact(int, int)} instead. * * @throws ArithmeticException if {@code a + b} overflows in signed {@code int} arithmetic */ @InlineMe(replacement = "Math.addExact(a, b)") public static int checkedAdd(int a, int b) { return Math.addExact(a, b); } /** * Returns the difference of {@code a} and {@code b}, provided it does not overflow. *Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Jan 29 22:14:05 GMT 2026 - 26.1K bytes - Click Count (0) -
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) {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Jul 14 14:44:08 GMT 2025 - 6.9K bytes - Click Count (0) -
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) {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Jul 14 14:44:08 GMT 2025 - 6.9K bytes - Click Count (0) -
android/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. *Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Mar 09 23:01:02 GMT 2026 - 46.8K bytes - Click Count (0) -
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
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Aug 11 19:31:30 GMT 2025 - 24.1K bytes - Click Count (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
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Aug 11 19:31:30 GMT 2025 - 24.1K bytes - Click Count (0)