Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for randomDouble (0.24 sec)

  1. 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++) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.6K bytes
    - Viewed (0)
  2. 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;
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.1K bytes
    - Viewed (0)
  3. 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++) {
    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)
  4. 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;
    
    /**
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.5K bytes
    - Viewed (0)
  5. 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;
    
    /**
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.5K bytes
    - Viewed (0)
  6. 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;
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.1K bytes
    - Viewed (0)
Back to top