- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 78 for Log2 (0.07 sec)
-
android/guava-tests/test/com/google/common/math/DoubleMathTest.java
int log2 = DoubleMath.log2(d, FLOOR); assertTrue(StrictMath.pow(2.0, log2) <= d); assertTrue(StrictMath.pow(2.0, log2 + 1) > d); } } @GwtIncompatible // DoubleMath.log2(double, RoundingMode), StrictMath public void testRoundLog2Ceiling() { for (double d : POSITIVE_FINITE_DOUBLE_CANDIDATES) { int log2 = DoubleMath.log2(d, CEILING);
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Feb 07 17:50:39 UTC 2024 - 28.1K bytes - Viewed (0) -
src/math/log10.go
} return log10(x) } func log10(x float64) float64 { return Log(x) * (1 / Ln10) } // Log2 returns the binary logarithm of x. // The special cases are the same as for [Log]. func Log2(x float64) float64 { if haveArchLog2 { return archLog2(x) } return log2(x) } func log2(x float64) float64 { frac, exp := Frexp(x) // Make sure exact powers of two give an exact answer.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 11:59:09 UTC 2023 - 873 bytes - Viewed (0) -
src/runtime/mkfastlog2table.go
for i := 0; i <= (1 << fastlogNumBits); i++ { fastlog2Table[i] = log2(1.0 + float64(i)/(1<<fastlogNumBits)) } return fastlog2Table } // log2 is a local copy of math.Log2 with an explicit float64 conversion // to disable FMA. This lets us generate the same output on all platforms. func log2(x float64) float64 { frac, exp := math.Frexp(x) // Make sure exact powers of two give an exact answer.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Jun 26 22:12:19 UTC 2022 - 3.1K bytes - Viewed (0) -
guava/src/com/google/common/math/BigIntegerMath.java
* definitely >= floor(sqrt(x)), and then continue the iteration until we reach a fixed point. */ BigInteger sqrt0; int log2 = log2(x, FLOOR); if (log2 < Double.MAX_EXPONENT) { sqrt0 = sqrtApproxWithDoubles(x); } else { int shift = (log2 - DoubleUtils.SIGNIFICAND_BITS) & ~1; // even! /* * We have that x / 2^shift < 2^54. Our initial approximation to sqrtFloor(x) will be
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Feb 07 17:50:39 UTC 2024 - 18.9K bytes - Viewed (0) -
android/guava/src/com/google/common/math/BigIntegerMath.java
* definitely >= floor(sqrt(x)), and then continue the iteration until we reach a fixed point. */ BigInteger sqrt0; int log2 = log2(x, FLOOR); if (log2 < Double.MAX_EXPONENT) { sqrt0 = sqrtApproxWithDoubles(x); } else { int shift = (log2 - DoubleUtils.SIGNIFICAND_BITS) & ~1; // even! /* * We have that x / 2^shift < 2^54. Our initial approximation to sqrtFloor(x) will be
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Feb 07 17:50:39 UTC 2024 - 18.9K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/math/MathBenchmarking.java
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. */ static BigInteger randomNonNegativeBigInteger(int numBits) { int digits = RANDOM_SOURCE.nextInt(numBits);
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 4.1K bytes - Viewed (0) -
src/sort/search_test.go
t.Errorf("Find got (%v, %v), want (%v, %v)", pos, found, tt.wantPos, tt.wantFound) } }) } } // log2 computes the binary logarithm of x, rounded up to the next integer. // (log2(0) == 0, log2(1) == 0, log2(2) == 1, log2(3) == 2, etc.) func log2(x int) int { n := 0 for p := 1; p < x; p += p { // p == 2**n n++ } // p/2 < x <= p == 2**n return n }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 07 14:42:13 UTC 2022 - 6.8K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/MathBenchmarking.java
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. */ static BigInteger randomNonNegativeBigInteger(int numBits) { int digits = RANDOM_SOURCE.nextInt(numBits);
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 4.1K bytes - Viewed (0) -
src/runtime/fastlog2_test.go
func TestFastLog2(t *testing.T) { // Compute the euclidean distance between math.Log2 and the FastLog2 // implementation over the range of interest for heap sampling. const randomBitCount = 26 var e float64 inc := 1 if testing.Short() { // Check 1K total values, down from 64M. inc = 1 << 16 } for i := 1; i < 1<<randomBitCount; i += inc { l, fl := math.Log2(float64(i)), runtime.Fastlog2(float64(i)) d := l - fl e += d * d
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 23:34:33 UTC 2016 - 784 bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java
} } @Param({"DOWN", "UP", "FLOOR", "CEILING", "HALF_EVEN", "HALF_UP", "HALF_DOWN"}) RoundingMode mode; @Benchmark int log2(int reps) { int tmp = 0; for (int i = 0; i < reps; i++) { int j = i & ARRAY_MASK; tmp += IntMath.log2(positive[j], mode); } return tmp; } @Benchmark int log10(int reps) { int tmp = 0; for (int i = 0; i < reps; i++) {
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 2.6K bytes - Viewed (0)