Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for testIsPowerOfTwo (0.45 sec)

  1. 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);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Mar 04 20:15:57 GMT 2024
    - 32.5K bytes
    - Viewed (0)
  2. 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);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 24.5K bytes
    - Viewed (0)
  3. 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);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 24.5K bytes
    - Viewed (0)
  4. 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);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.2K bytes
    - Viewed (0)
  5. android/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);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.2K bytes
    - Viewed (0)
  6. 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)
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.1K bytes
    - Viewed (0)
  7. 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)
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.1K bytes
    - Viewed (0)
  8. android/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);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Mar 04 20:15:57 GMT 2024
    - 32.5K bytes
    - Viewed (0)
Back to top