Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 5 of 5 for roundToBigInteger (0.16 seconds)

  1. android/guava/src/com/google/common/math/DoubleMath.java

      @GwtIncompatible
      // Whenever both tests are cheap and functional, it's faster to use &, | instead of &&, ||
      @SuppressWarnings("ShortCircuitBoolean")
      public static BigInteger roundToBigInteger(double x, RoundingMode mode) {
        x = roundIntermediate(x, mode);
        if (MIN_LONG_AS_DOUBLE - x < 1.0 & x < MAX_LONG_AS_DOUBLE_PLUS_ONE) {
          return BigInteger.valueOf((long) x);
        }
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Aug 07 16:05:33 GMT 2025
    - 19.3K bytes
    - Click Count (0)
  2. guava-tests/test/com/google/common/math/DoubleMathTest.java

          assertEquals(expected.toBigInteger(), DoubleMath.roundToBigInteger(d, UNNECESSARY));
        }
      }
    
      @GwtIncompatible // DoubleMath.roundToBigInteger(double, RoundingMode)
      public void testRoundExactFractionalDoubleToBigIntegerFails() {
        for (double d : FRACTIONAL_DOUBLE_CANDIDATES) {
          assertThrows(ArithmeticException.class, () -> DoubleMath.roundToBigInteger(d, UNNECESSARY));
        }
      }
    
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue Feb 03 16:20:39 GMT 2026
    - 27.5K bytes
    - Click Count (0)
  3. android/guava-tests/test/com/google/common/math/DoubleMathTest.java

          assertEquals(expected.toBigInteger(), DoubleMath.roundToBigInteger(d, UNNECESSARY));
        }
      }
    
      @GwtIncompatible // DoubleMath.roundToBigInteger(double, RoundingMode)
      public void testRoundExactFractionalDoubleToBigIntegerFails() {
        for (double d : FRACTIONAL_DOUBLE_CANDIDATES) {
          assertThrows(ArithmeticException.class, () -> DoubleMath.roundToBigInteger(d, UNNECESSARY));
        }
      }
    
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue Feb 03 16:20:39 GMT 2026
    - 27.5K bytes
    - Click Count (0)
  4. guava-tests/test/com/google/common/math/BigIntegerMathTest.java

            .test();
      }
    
      @J2ktIncompatible
      @GwtIncompatible
      public void testRoundToDouble_maxDouble() {
        BigInteger maxDoubleAsBigInteger = DoubleMath.roundToBigInteger(Double.MAX_VALUE, UNNECESSARY);
        new RoundToDoubleTester(maxDoubleAsBigInteger)
            .setExpectation(Double.MAX_VALUE, RoundingMode.values())
            .test();
      }
    
      @J2ktIncompatible
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue Mar 03 04:51:56 GMT 2026
    - 27.1K bytes
    - Click Count (0)
  5. android/guava/src/com/google/common/math/BigIntegerMath.java

        } while (sqrt1.compareTo(sqrt0) < 0);
        return sqrt0;
      }
    
      @GwtIncompatible // TODO
      private static BigInteger sqrtApproxWithDoubles(BigInteger x) {
        return DoubleMath.roundToBigInteger(Math.sqrt(DoubleUtils.bigToDouble(x)), HALF_EVEN);
      }
    
      /**
       * Returns {@code x}, rounded to a {@code double} with the specified rounding mode. If {@code x}
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Aug 07 16:05:33 GMT 2025
    - 18.8K bytes
    - Click Count (0)
Back to Top