- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 1,559 for log2 (0.04 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
// Log10 returns the decimal logarithm of x. // The special cases are the same as for [Log]. func Log10(x float64) float64 { if haveArchLog10 { return archLog10(x) } 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) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 11:59:09 UTC 2023 - 873 bytes - Viewed (0) -
guava/src/com/google/common/math/BigIntegerMath.java
// Strip off 2s from this value. int shift = Long.numberOfTrailingZeros(product); product >>= shift; // Use floor(log2(num)) + 1 to prevent overflow of multiplication. int productBits = LongMath.log2(product, FLOOR) + 1; int bits = LongMath.log2(startingNumber, FLOOR) + 1; // Check for the next power of two boundary, to save us a CLZ operation. int nextPowerOfTwo = 1 << (bits - 1);
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Feb 07 17:50:39 UTC 2024 - 18.9K bytes - Viewed (0) -
src/runtime/mkfastlog2table.go
log.Fatalln(err) } } const fastlogNumBits = 5 func computeTable() []float64 { fastlog2Table := make([]float64, 1<<fastlogNumBits+1) 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
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Jun 26 22:12:19 UTC 2022 - 3.1K bytes - Viewed (0) -
android/guava/src/com/google/common/math/BigIntegerMath.java
// Strip off 2s from this value. int shift = Long.numberOfTrailingZeros(product); product >>= shift; // Use floor(log2(num)) + 1 to prevent overflow of multiplication. int productBits = LongMath.log2(product, FLOOR) + 1; int bits = LongMath.log2(startingNumber, FLOOR) + 1; // Check for the next power of two boundary, to save us a CLZ operation. int nextPowerOfTwo = 1 << (bits - 1);
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) -
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) -
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) -
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)