Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for roundToInt (0.18 sec)

  1. guava-tests/test/com/google/common/math/DoubleMathTest.java

          try {
            DoubleMath.roundToInt(d, UNNECESSARY);
            fail("Expected ArithmeticException");
          } catch (ArithmeticException expected) {
          }
        }
      }
    
      @GwtIncompatible // DoubleMath.roundToInt(double, RoundingMode)
      public void testRoundNaNToIntAlwaysFails() {
        for (RoundingMode mode : ALL_ROUNDING_MODES) {
          try {
            DoubleMath.roundToInt(Double.NaN, mode);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.1K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/math/DoubleMathTest.java

          try {
            DoubleMath.roundToInt(d, UNNECESSARY);
            fail("Expected ArithmeticException");
          } catch (ArithmeticException expected) {
          }
        }
      }
    
      @GwtIncompatible // DoubleMath.roundToInt(double, RoundingMode)
      public void testRoundNaNToIntAlwaysFails() {
        for (RoundingMode mode : ALL_ROUNDING_MODES) {
          try {
            DoubleMath.roundToInt(Double.NaN, mode);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.1K bytes
    - Viewed (0)
  3. android/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java

          doubleInLongRange[i] = randomDouble(Long.SIZE - 2);
          positiveDoubles[i] = randomPositiveDouble();
        }
      }
    
      @Benchmark
      int roundToInt(int reps) {
        int tmp = 0;
        for (int i = 0; i < reps; i++) {
          int j = i & ARRAY_MASK;
          tmp += DoubleMath.roundToInt(doubleInIntRange[j], mode);
        }
        return tmp;
      }
    
      @Benchmark
      long roundToLong(int reps) {
        long tmp = 0;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.6K bytes
    - Viewed (0)
  4. guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java

          doubleInLongRange[i] = randomDouble(Long.SIZE - 2);
          positiveDoubles[i] = randomPositiveDouble();
        }
      }
    
      @Benchmark
      int roundToInt(int reps) {
        int tmp = 0;
        for (int i = 0; i < reps; i++) {
          int j = i & ARRAY_MASK;
          tmp += DoubleMath.roundToInt(doubleInIntRange[j], mode);
        }
        return tmp;
      }
    
      @Benchmark
      long roundToLong(int reps) {
        long tmp = 0;
    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)
  5. android/guava/src/com/google/common/math/DoubleMath.java

       *       <li>{@code x} is not a mathematical integer and {@code mode} is {@link
       *           RoundingMode#UNNECESSARY}
       *     </ul>
       */
      @GwtIncompatible // #roundIntermediate
      public static int roundToInt(double x, RoundingMode mode) {
        double z = roundIntermediate(x, mode);
        checkInRangeForRoundingInputs(
            z > MIN_INT_AS_DOUBLE - 1.0 & z < MAX_INT_AS_DOUBLE + 1.0, x, mode);
        return (int) z;
      }
    
    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)
Back to top