Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for isPowerOfTwo (0.09 sec)

  1. src/test/java/jcifs/FileNotifyInformationTest.java

                assertTrue(isPowerOfTwo(FileNotifyInformation.FILE_NOTIFY_CHANGE_FILE_NAME));
                assertTrue(isPowerOfTwo(FileNotifyInformation.FILE_NOTIFY_CHANGE_DIR_NAME));
                assertTrue(isPowerOfTwo(FileNotifyInformation.FILE_NOTIFY_CHANGE_ATTRIBUTES));
                assertTrue(isPowerOfTwo(FileNotifyInformation.FILE_NOTIFY_CHANGE_SIZE));
                assertTrue(isPowerOfTwo(FileNotifyInformation.FILE_NOTIFY_CHANGE_LAST_WRITE));
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 18.1K bytes
    - Viewed (0)
  2. src/test/java/jcifs/internal/dtyp/SecurityInfoTest.java

            assertTrue(isPowerOfTwo(SecurityInfo.OWNER_SECURITY_INFO));
            assertTrue(isPowerOfTwo(SecurityInfo.GROUP_SECURITY_INFO));
            assertTrue(isPowerOfTwo(SecurityInfo.DACL_SECURITY_INFO));
            assertTrue(isPowerOfTwo(SecurityInfo.SACL_SECURITY_INFO));
            assertTrue(isPowerOfTwo(SecurityInfo.LABEL_SECURITY_INFO));
            assertTrue(isPowerOfTwo(SecurityInfo.ATTRIBUTE_SECURITY_INFO));
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 7.5K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/math/DoubleMathTest.java

        for (double x : POSITIVE_FINITE_DOUBLE_CANDIDATES) {
          boolean isPowerOfTwo = StrictMath.pow(2.0, DoubleMath.log2(x, FLOOR)) == x;
          try {
            int log2 = DoubleMath.log2(x, UNNECESSARY);
            assertThat(Math.scalb(1.0, log2)).isEqualTo(x);
            assertTrue(isPowerOfTwo);
          } catch (ArithmeticException e) {
            assertFalse(isPowerOfTwo);
          }
        }
      }
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 27.3K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/math/BigIntegerMathTest.java

          assertTrue(BigIntegerMath.isPowerOfTwo(result));
          assertTrue(result.compareTo(x) >= 0);
          assertTrue(result.compareTo(x.add(x)) < 0);
        }
      }
    
      public void testFloorPowerOfTwo() {
        for (BigInteger x : POSITIVE_BIGINTEGER_CANDIDATES) {
          BigInteger result = BigIntegerMath.floorPowerOfTwo(x);
          assertTrue(BigIntegerMath.isPowerOfTwo(result));
          assertTrue(result.compareTo(x) <= 0);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 27K bytes
    - Viewed (0)
  5. android/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java

          if (DoubleMath.isMathematicalInteger(doubles[j])) {
            tmp++;
          }
        }
        return tmp;
      }
    
      @Benchmark
      int isPowerOfTwo(int reps) {
        int tmp = 0;
        for (int i = 0; i < reps; i++) {
          int j = i & ARRAY_MASK;
          if (DoubleMath.isPowerOfTwo(doubles[j])) {
            tmp++;
          }
        }
        return tmp;
      }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Dec 19 18:03:30 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/math/IntMathTest.java

    @GwtCompatible
    @NullUnmarked
    public class IntMathTest extends TestCase {
      public void testMaxSignedPowerOfTwo() {
        assertTrue(IntMath.isPowerOfTwo(IntMath.MAX_SIGNED_POWER_OF_TWO));
    
        // Extra work required to make GWT happy.
        long value = IntMath.MAX_SIGNED_POWER_OF_TWO * 2L;
        assertFalse(IntMath.isPowerOfTwo((int) value));
      }
    
      public void testCeilingPowerOfTwo() {
        for (int x : POSITIVE_INTEGER_CANDIDATES) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 24.1K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/math/LongMathTest.java

    @GwtCompatible
    @NullUnmarked
    public class LongMathTest extends TestCase {
      @SuppressWarnings("ConstantOverflow")
      public void testMaxSignedPowerOfTwo() {
        assertTrue(LongMath.isPowerOfTwo(LongMath.MAX_SIGNED_POWER_OF_TWO));
        assertFalse(LongMath.isPowerOfTwo(LongMath.MAX_SIGNED_POWER_OF_TWO * 2));
      }
    
      public void testCeilingPowerOfTwo() {
        for (long x : POSITIVE_LONG_CANDIDATES) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 31.4K bytes
    - Viewed (0)
  8. guava/src/com/google/common/math/BigIntegerMath.java

        int logFloor = x.bitLength() - 1;
        switch (mode) {
          case UNNECESSARY:
            checkRoundingUnnecessary(isPowerOfTwo(x)); // fall through
          case DOWN:
          case FLOOR:
            return logFloor;
    
          case UP:
          case CEILING:
            return isPowerOfTwo(x) ? logFloor : logFloor + 1;
    
          case HALF_DOWN:
          case HALF_UP:
          case HALF_EVEN:
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 18.8K bytes
    - Viewed (0)
  9. src/test/java/jcifs/internal/smb2/Smb2ConstantsTest.java

                // Verify each is a power of 2
                for (int cap : capabilities) {
                    assertTrue(isPowerOfTwo(cap), "Capability 0x" + Integer.toHexString(cap) + " should be a power of 2");
                }
    
                // Verify no overlapping bits
                for (int i = 0; i < capabilities.length; i++) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 14.1K bytes
    - Viewed (0)
  10. 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 boolean isPowerOfTwo(long x) {
        return x > 0 & (x & (x - 1)) == 0;
      }
    
      /**
       * Returns 1 if {@code x < y} as unsigned longs, and 0 otherwise. Assumes that x - y fits into a
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Fri Aug 29 16:20:07 UTC 2025
    - 46.8K bytes
    - Viewed (0)
Back to top