- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for randomDouble (0.12 sec)
-
android/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java
RoundingMode mode; @BeforeExperiment void setUp() { for (int i = 0; i < ARRAY_SIZE; i++) { doubleInIntRange[i] = randomDouble(Integer.SIZE - 2); doubleInLongRange[i] = randomDouble(Long.SIZE - 2); positiveDoubles[i] = randomPositiveDouble(); } } @Benchmark int roundToInt(int reps) { int tmp = 0; for (int i = 0; i < reps; i++) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 2.6K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java
RoundingMode mode; @BeforeExperiment void setUp() { for (int i = 0; i < ARRAY_SIZE; i++) { doubleInIntRange[i] = randomDouble(Integer.SIZE - 2); doubleInLongRange[i] = randomDouble(Long.SIZE - 2); positiveDoubles[i] = randomPositiveDouble(); } } @Benchmark int roundToInt(int reps) { int tmp = 0; for (int i = 0; i < reps; i++) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 2.6K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java
import static com.google.common.math.MathBenchmarking.ARRAY_SIZE; import static com.google.common.math.MathBenchmarking.RANDOM_SOURCE; import static com.google.common.math.MathBenchmarking.randomDouble; import static com.google.common.math.MathBenchmarking.randomPositiveDouble; import com.google.caliper.BeforeExperiment; import com.google.caliper.Benchmark; /**
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 2.5K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/math/MathBenchmarking.java
* result is chosen from those possibilities uniformly at random. * * <p>Zero is treated as having log2 == 0. */ static double randomDouble(int maxExponent) { double result = RANDOM_SOURCE.nextDouble(); result = Math.scalb(result, RANDOM_SOURCE.nextInt(maxExponent + 1)); return RANDOM_SOURCE.nextBoolean() ? result : -result; }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 4.1K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/MathBenchmarking.java
* result is chosen from those possibilities uniformly at random. * * <p>Zero is treated as having log2 == 0. */ static double randomDouble(int maxExponent) { double result = RANDOM_SOURCE.nextDouble(); result = Math.scalb(result, RANDOM_SOURCE.nextInt(maxExponent + 1)); return RANDOM_SOURCE.nextBoolean() ? result : -result; }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 4.1K bytes - Viewed (0)