Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for testIsPowerOfTwo (0.26 sec)

  1. android/guava-tests/test/com/google/common/math/DoubleMathTest.java

          assertTrue(DoubleMath.isPowerOfTwo(StrictMath.pow(2.0, i)));
        }
      }
    
      @GwtIncompatible // DoubleMath.isPowerOfTwo, DoubleMath.log2(double, RoundingMode), StrictMath
      public void testIsPowerOfTwo() {
        for (double x : ALL_DOUBLE_CANDIDATES) {
          boolean expected =
              x > 0
                  && !Double.isInfinite(x)
                  && !Double.isNaN(x)
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 27.3K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/math/BigIntegerMathTest.java

        assertEquals(
            BigIntegerMath.sqrt(
                BigInteger.ZERO.setBit(2 * BigIntegerMath.SQRT2_PRECOMPUTE_THRESHOLD + 1), FLOOR),
            BigIntegerMath.SQRT2_PRECOMPUTED_BITS);
      }
    
      public void testIsPowerOfTwo() {
        for (BigInteger x : ALL_BIGINTEGER_CANDIDATES) {
          // Checks for a single bit set.
          boolean expected = x.signum() > 0 & x.and(x.subtract(ONE)).equals(ZERO);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 27K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/math/IntMathTest.java

              int actual = IntMath.lessThanBranchFree(x, y);
              assertEquals(expected, actual);
            }
          }
        }
      }
    
      @GwtIncompatible // java.math.BigInteger
      public void testIsPowerOfTwo() {
        for (int x : ALL_INTEGER_CANDIDATES) {
          // Checks for a single bit set.
          BigInteger bigX = BigInteger.valueOf(x);
          boolean expected = (bigX.signum() > 0) && (bigX.bitCount() == 1);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 24.1K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/math/LongMathTest.java

        for (int i = 0; i < k; i++) {
          accum = LongMath.checkedMultiply(accum, n - i);
          accum /= i + 1;
        }
        return accum;
      }
    
      @GwtIncompatible // java.math.BigInteger
      public void testIsPowerOfTwo() {
        for (long x : ALL_LONG_CANDIDATES) {
          // Checks for a single bit set.
          BigInteger bigX = BigInteger.valueOf(x);
          boolean expected = (bigX.signum() > 0) && (bigX.bitCount() == 1);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 31.4K bytes
    - Viewed (0)
Back to top