- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for checkedPow (0.08 sec)
-
guava/src/com/google/common/math/LongMath.java
public static long checkedPow(long b, int k) { checkNonNegative("exponent", k); if (b >= -2 & b <= 2) { switch ((int) b) { case 0: return (k == 0) ? 1 : 0; case 1: return 1; case (-1): return ((k & 1) == 0) ? 1 : -1; case 2: checkNoOverflow(k < Long.SIZE - 1, "checkedPow", b, k); return 1L << k;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 09 16:39:37 UTC 2024 - 45.2K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/LongMathTest.java
@GwtIncompatible // TODO public void testConstantsPowersOf10() { for (int i = 0; i < LongMath.powersOf10.length; i++) { assertEquals(LongMath.checkedPow(10, i), LongMath.powersOf10[i]); } assertThrows( ArithmeticException.class, () -> LongMath.checkedPow(10, LongMath.powersOf10.length)); } @GwtIncompatible // TODO public void testConstantsHalfPowersOf10() {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 15:00:32 UTC 2024 - 30.6K bytes - Viewed (0) -
android/guava/src/com/google/common/math/LongMath.java
public static long checkedPow(long b, int k) { checkNonNegative("exponent", k); if (b >= -2 & b <= 2) { switch ((int) b) { case 0: return (k == 0) ? 1 : 0; case 1: return 1; case (-1): return ((k & 1) == 0) ? 1 : -1; case 2: checkNoOverflow(k < Long.SIZE - 1, "checkedPow", b, k); return 1L << k;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 09 16:39:37 UTC 2024 - 45.2K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/IntMathTest.java
BigInteger expectedResult = valueOf(b).pow(k); boolean expectedSuccess = fitsInInt(expectedResult); try { assertEquals(b + "^" + k, force32(expectedResult.intValue()), IntMath.checkedPow(b, k)); assertTrue(b + "^" + k + " should have succeeded", expectedSuccess); } catch (ArithmeticException e) { assertFalse(b + "^" + k + " should have failed", expectedSuccess); }
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-tests/test/com/google/common/math/IntMathTest.java
BigInteger expectedResult = valueOf(b).pow(k); boolean expectedSuccess = fitsInInt(expectedResult); try { assertEquals(b + "^" + k, force32(expectedResult.intValue()), IntMath.checkedPow(b, k)); assertTrue(b + "^" + k + " should have succeeded", expectedSuccess); } catch (ArithmeticException e) { assertFalse(b + "^" + k + " should have failed", expectedSuccess); }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 23.1K bytes - Viewed (0)