- Sort Score
- Num 10 results
- Language All
Results 1 - 4 of 4 for floorPowerOfTwo (0.19 seconds)
-
guava-tests/test/com/google/common/math/BigIntegerMathTest.java
} } public void testCeilingPowerOfTwoZero() { assertThrows( IllegalArgumentException.class, () -> BigIntegerMath.ceilingPowerOfTwo(BigInteger.ZERO)); } public void testFloorPowerOfTwoZero() { assertThrows( IllegalArgumentException.class, () -> BigIntegerMath.floorPowerOfTwo(BigInteger.ZERO)); }
Created: Fri Dec 26 12:43:10 GMT 2025 - Last Modified: Wed Nov 19 01:35:24 GMT 2025 - 27.1K bytes - Click Count (0) -
guava-tests/test/com/google/common/math/IntMathTest.java
} } } public void testFloorPowerOfTwo() { for (int x : POSITIVE_INTEGER_CANDIDATES) { BigInteger expectedResult = BigIntegerMath.floorPowerOfTwo(BigInteger.valueOf(x)); assertEquals(expectedResult.intValue(), IntMath.floorPowerOfTwo(x)); } } public void testCeilingPowerOfTwoNegative() { for (int x : NEGATIVE_INTEGER_CANDIDATES) {Created: Fri Dec 26 12:43:10 GMT 2025 - Last Modified: Mon Aug 11 19:31:30 GMT 2025 - 24.1K bytes - Click Count (0) -
guava/src/com/google/common/math/BigIntegerMath.java
* BigInteger.valueOf(2).pow(log2(x, FLOOR))}. * * @throws IllegalArgumentException if {@code x <= 0} * @since 20.0 */ public static BigInteger floorPowerOfTwo(BigInteger x) { return BigInteger.ZERO.setBit(log2(x, FLOOR)); } /** Returns {@code true} if {@code x} represents a power of two. */ public static boolean isPowerOfTwo(BigInteger x) { checkNotNull(x);
Created: Fri Dec 26 12:43:10 GMT 2025 - Last Modified: Thu Aug 07 16:05:33 GMT 2025 - 18.8K bytes - Click Count (0) -
guava/src/com/google/common/math/LongMath.java
* checkedPow(2, log2(x, FLOOR))}. * * @throws IllegalArgumentException if {@code x <= 0} * @since 20.0 */ public static long floorPowerOfTwo(long x) { checkPositive("x", x); // Long.highestOneBit was buggy on GWT. We've fixed it, but I'm not certain when the fix will // be released.
Created: Fri Dec 26 12:43:10 GMT 2025 - Last Modified: Mon Nov 03 21:01:09 GMT 2025 - 46.8K bytes - Click Count (0)