Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 66 for floor (0.16 sec)

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

      // Relies on the correctness of sqrt(BigInteger, FLOOR).
      @GwtIncompatible // TODO
      public void testSqrtExact() {
        for (BigInteger x : POSITIVE_BIGINTEGER_CANDIDATES) {
          BigInteger floor = BigIntegerMath.sqrt(x, FLOOR);
          // We only expect an exception if x was not a perfect square.
          boolean isPerfectSquare = floor.pow(2).equals(x);
          try {
            assertEquals(floor, BigIntegerMath.sqrt(x, UNNECESSARY));
    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)
  2. android/guava-tests/test/com/google/common/math/BigIntegerMathTest.java

      // Relies on the correctness of sqrt(BigInteger, FLOOR).
      @GwtIncompatible // TODO
      public void testSqrtExact() {
        for (BigInteger x : POSITIVE_BIGINTEGER_CANDIDATES) {
          BigInteger floor = BigIntegerMath.sqrt(x, FLOOR);
          // We only expect an exception if x was not a perfect square.
          boolean isPerfectSquare = floor.pow(2).equals(x);
          try {
            assertEquals(floor, BigIntegerMath.sqrt(x, UNNECESSARY));
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.2K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/math/LongMath.java

         * can narrow the possible floor(log10(x)) values to two. For example, if floor(log2(x)) is 6,
         * then 64 <= x < 128, so floor(log10(x)) is either 1 or 2.
         */
        int y = maxLog10ForLeadingZeros[Long.numberOfLeadingZeros(x)];
        /*
         * y is the higher of the two possible values of floor(log10(x)). If x < 10^y, then we want the
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 44.6K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/math/IntMathTest.java

      }
    
      /* Relies on the correctness of sqrt(int, FLOOR). */
      @GwtIncompatible // sqrt
      public void testSqrtExactMatchesFloorOrThrows() {
        for (int x : POSITIVE_INTEGER_CANDIDATES) {
          int floor = IntMath.sqrt(x, FLOOR);
          // We only expect an exception if x was not a perfect square.
          boolean isPerfectSquare = (floor * floor == x);
          try {
            assertEquals(floor, IntMath.sqrt(x, UNNECESSARY));
    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)
  5. android/guava-testlib/src/com/google/common/collect/testing/SafeTreeSet.java

        return new SafeTreeSet<>(delegate.descendingSet());
      }
    
      @Override
      public E first() {
        return delegate.first();
      }
    
      @Override
      public @Nullable E floor(E e) {
        return delegate.floor(checkValid(e));
      }
    
      @Override
      public SortedSet<E> headSet(E toElement) {
        return headSet(toElement, false);
      }
    
      @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/math/MathBenchmarking.java

        do {
          result = randomNonNegativeBigInteger(numBits);
        } while (result.signum() == 0);
        return result;
      }
    
      /**
       * Generates a number in [0, 2^numBits) with an exponential distribution. The floor of the log2 of
       * the result is chosen uniformly at random in [0, numBits), and then the result is chosen in that
       * range uniformly at random. Zero is treated as having log2 == 0.
       */
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.1K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/math/LongMathTest.java

          }
        }
      }
    
      // Relies on the correctness of log10(long, FLOOR) and of pow(long, int).
      @GwtIncompatible // TODO
      public void testLog10Exact() {
        for (long x : POSITIVE_LONG_CANDIDATES) {
          int floor = LongMath.log10(x, FLOOR);
          boolean expectedSuccess = LongMath.pow(10, floor) == x;
          try {
            assertEquals(floor, LongMath.log10(x, UNNECESSARY));
            assertTrue(expectedSuccess);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Mar 04 20:15:57 GMT 2024
    - 32.5K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/collect/ForwardingNavigableSetTest.java

          return standardSubSet(fromElement, toElement);
        }
    
        @Override
        public @Nullable T lower(T e) {
          return standardLower(e);
        }
    
        @Override
        public @Nullable T floor(T e) {
          return standardFloor(e);
        }
    
        @Override
        public @Nullable T ceiling(T e) {
          return standardCeiling(e);
        }
    
        @Override
        public @Nullable T higher(T e) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 6.9K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/TreeMultiset.java

        @CheckForNull
        private AvlNode<E> floor(Comparator<? super E> comparator, @ParametricNullness E e) {
          int cmp = comparator.compare(e, getElement());
          if (cmp > 0) {
            return (right == null) ? this : MoreObjects.firstNonNull(right.floor(comparator, e), this);
          } else if (cmp == 0) {
            return this;
          } else {
            return (left == null) ? null : left.floor(comparator, e);
          }
        }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 34.2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/math/ToDoubleRounder.java

                }
                roundFloor = toX(roundFloorAsDouble, RoundingMode.FLOOR);
              }
    
              X deltaToFloor = minus(x, roundFloor);
              X deltaToCeiling = minus(roundCeiling, x);
              int diff = deltaToFloor.compareTo(deltaToCeiling);
              if (diff < 0) { // closer to floor
                return roundFloorAsDouble;
              } else if (diff > 0) { // closer to ceiling
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 5.8K bytes
    - Viewed (0)
Back to top