Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for roundToLong (0.21 sec)

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

          try {
            DoubleMath.roundToLong(d, UNNECESSARY);
            fail("Expected ArithmeticException");
          } catch (ArithmeticException expected) {
          }
        }
      }
    
      @GwtIncompatible // DoubleMath.roundToLong(double, RoundingMode)
      public void testRoundNaNToLongAlwaysFails() {
        for (RoundingMode mode : ALL_ROUNDING_MODES) {
          try {
            DoubleMath.roundToLong(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.roundToLong(d, UNNECESSARY);
            fail("Expected ArithmeticException");
          } catch (ArithmeticException expected) {
          }
        }
      }
    
      @GwtIncompatible // DoubleMath.roundToLong(double, RoundingMode)
      public void testRoundNaNToLongAlwaysFails() {
        for (RoundingMode mode : ALL_ROUNDING_MODES) {
          try {
            DoubleMath.roundToLong(Double.NaN, mode);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.1K bytes
    - Viewed (0)
  3. guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java

          int j = i & ARRAY_MASK;
          tmp += DoubleMath.roundToInt(doubleInIntRange[j], mode);
        }
        return tmp;
      }
    
      @Benchmark
      long roundToLong(int reps) {
        long tmp = 0;
        for (int i = 0; i < reps; i++) {
          int j = i & ARRAY_MASK;
          tmp += DoubleMath.roundToLong(doubleInLongRange[j], mode);
        }
        return tmp;
      }
    
      @Benchmark
      int roundToBigInteger(int reps) {
        int 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)
  4. android/guava-tests/benchmark/com/google/common/math/DoubleMathRoundingBenchmark.java

          int j = i & ARRAY_MASK;
          tmp += DoubleMath.roundToInt(doubleInIntRange[j], mode);
        }
        return tmp;
      }
    
      @Benchmark
      long roundToLong(int reps) {
        long tmp = 0;
        for (int i = 0; i < reps; i++) {
          int j = i & ARRAY_MASK;
          tmp += DoubleMath.roundToLong(doubleInLongRange[j], mode);
        }
        return tmp;
      }
    
      @Benchmark
      int roundToBigInteger(int reps) {
        int tmp = 0;
    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)
  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 long roundToLong(double x, RoundingMode mode) {
        double z = roundIntermediate(x, mode);
        checkInRangeForRoundingInputs(
            MIN_LONG_AS_DOUBLE - z < 1.0 & z < MAX_LONG_AS_DOUBLE_PLUS_ONE, x, mode);
        return (long) 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)
  6. android/guava/src/com/google/common/hash/BloomFilter.java

         * is close to 1 (why?), gives the following formula.
         */
        double fractionOfBitsSet = (double) bitCount / bitSize;
        return DoubleMath.roundToLong(
            -Math.log1p(-fractionOfBitsSet) * bitSize / numHashFunctions, RoundingMode.HALF_UP);
      }
    
      /** Returns the number of bits in the underlying bit array. */
      @VisibleForTesting
      long bitSize() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 23.1K bytes
    - Viewed (0)
Back to top