- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for checkedAdd (0.05 sec)
-
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 Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 15:00:32 UTC 2024 - 30.6K bytes - Viewed (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
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 23.1K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/ConcurrentHashMultiset.java
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 21.1K bytes - Viewed (0) -
guava/src/com/google/common/math/LongMath.java
*/ // Whenever both tests are cheap and functional, it's faster to use &, | instead of &&, || @SuppressWarnings("ShortCircuitBoolean") public static long checkedAdd(long a, long b) { long result = a + b; checkNoOverflow((a ^ b) < 0 | (a ^ result) >= 0, "checkedAdd", a, b); return result; } /** * Returns the difference of {@code a} and {@code b}, provided it does not overflow. *
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 09 16:39:37 UTC 2024 - 45.2K 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 Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 23.1K bytes - Viewed (0) -
android/guava/src/com/google/common/math/LongMath.java
*/ // Whenever both tests are cheap and functional, it's faster to use &, | instead of &&, || @SuppressWarnings("ShortCircuitBoolean") public static long checkedAdd(long a, long b) { long result = a + b; checkNoOverflow((a ^ b) < 0 | (a ^ result) >= 0, "checkedAdd", a, b); return result; } /** * Returns the difference of {@code a} and {@code b}, provided it does not overflow. *
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 09 16:39:37 UTC 2024 - 45.2K bytes - Viewed (0)