Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 16 of 16 for log10 (0.26 sec)

  1. android/guava/src/com/google/common/math/BigIntegerMath.java

       *     is not a power of ten
       */
      @GwtIncompatible // TODO
      @SuppressWarnings("fallthrough")
      public static int log10(BigInteger x, RoundingMode mode) {
        checkPositive("x", x);
        if (fitsInLong(x)) {
          return LongMath.log10(x.longValue(), mode);
        }
    
        int approxLog10 = (int) (log2(x, FLOOR) * LN_2 / LN_10);
        BigInteger approxPow = BigInteger.TEN.pow(approxLog10);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 18.9K bytes
    - Viewed (0)
  2. 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)
  3. guava-tests/test/com/google/common/math/LongMathTest.java

            assertEquals(BigIntegerMath.log10(valueOf(x), mode), LongMath.log10(x, mode));
          }
        }
      }
    
      // 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;
    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)
  4. android/guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java

          int j = i & ARRAY_MASK;
          tmp += LongMath.log2(positive[j], mode);
        }
        return tmp;
      }
    
      @Benchmark
      int log10(int reps) {
        int tmp = 0;
        for (int i = 0; i < reps; i++) {
          int j = i & ARRAY_MASK;
          tmp += LongMath.log10(positive[j], mode);
        }
        return tmp;
      }
    
      @Benchmark
      int sqrt(int reps) {
        int tmp = 0;
        for (int i = 0; i < reps; i++) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.6K bytes
    - Viewed (0)
  5. android/guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java

          int j = i & ARRAY_MASK;
          tmp += BigIntegerMath.log2(positive[j], mode);
        }
        return tmp;
      }
    
      @Benchmark
      int log10(int reps) {
        int tmp = 0;
        for (int i = 0; i < reps; i++) {
          int j = i & ARRAY_MASK;
          tmp += BigIntegerMath.log10(positive[j], mode);
        }
        return tmp;
      }
    
      @Benchmark
      int sqrt(int reps) {
        int tmp = 0;
        for (int i = 0; i < reps; i++) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Jun 30 13:06:20 GMT 2020
    - 2.8K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/hash/BloomFilter.java

         * is close to 1 (why?), gives the following formula.
         */
        double fractionOfBitsSet = (double) bitCount / bitSize;
        return DoubleMath.roundToLong(
            -Math.log1p(-fractionOfBitsSet) * bitSize / numHashFunctions, RoundingMode.HALF_UP);
      }
    
      /** Returns the number of bits in the underlying bit array. */
      @VisibleForTesting
      long bitSize() {
        return bits.bitSize();
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 23.1K bytes
    - Viewed (0)
Back to top