Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 40 for ArithmeticException (0.08 sec)

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

       * values are even integers; this method returns the one that is a multiple of a greater power of
       * two.)
       *
       * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
       *     is not precisely representable as a {@code double}
       * @since 30.0
       */
      public static double roundToDouble(BigDecimal x, RoundingMode mode) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Jul 17 15:26:41 UTC 2025
    - 3K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/math/BigDecimalMathTest.java

            assertWithMessage("Expected roundUnnecessaryShouldThrow call")
                .that(unnecessaryShouldThrow)
                .isTrue();
            assertThrows(
                "Expected ArithmeticException for roundToDouble(" + input + ", UNNECESSARY)",
                ArithmeticException.class,
                () -> BigDecimalMath.roundToDouble(input, UNNECESSARY));
          }
        }
      }
    
      public void testRoundToDouble_zero() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Jul 14 14:44:08 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  3. guava/src/com/google/common/math/BigDecimalMath.java

       * values are even integers; this method returns the one that is a multiple of a greater power of
       * two.)
       *
       * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
       *     is not precisely representable as a {@code double}
       * @since 30.0
       */
      public static double roundToDouble(BigDecimal x, RoundingMode mode) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Jul 17 15:26:41 UTC 2025
    - 3K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/CartesianList.java

        axesSizeProduct[axes.size()] = 1;
        try {
          for (int i = axes.size() - 1; i >= 0; i--) {
            axesSizeProduct[i] = Math.multiplyExact(axesSizeProduct[i + 1], axes.get(i).size());
          }
        } catch (ArithmeticException e) {
          throw new IllegalArgumentException(
              "Cartesian product too large; must have size at most Integer.MAX_VALUE");
        }
        this.axesSizeProduct = axesSizeProduct;
      }
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sun Aug 31 13:15:26 UTC 2025
    - 4.7K bytes
    - Viewed (0)
  5. guava/src/com/google/common/math/ToDoubleRounder.java

                  ? Double.POSITIVE_INFINITY
                  : -Double.MAX_VALUE;
            case UP:
              return roundArbitrarily;
            case UNNECESSARY:
              throw new ArithmeticException(x + " cannot be represented precisely as a double");
          }
        }
        X roundArbitrarilyAsX = toX(roundArbitrarily, RoundingMode.UNNECESSARY);
        int cmpXToRoundArbitrarily = x.compareTo(roundArbitrarilyAsX);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Dec 21 03:10:51 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/cache/CacheBuilder.java

       * @throws IllegalArgumentException if {@code duration} is negative
       * @throws IllegalStateException if {@link #expireAfterWrite} was already set
       * @throws ArithmeticException for durations greater than +/- approximately 292 years
       * @since 33.3.0 (but since 25.0 in the JRE <a
       *     href="https://github.com/google/guava#guava-google-core-libraries-for-java">flavor</a>)
       */
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 51.7K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/primitives/UnsignedLongs.java

       *
       * <p><b>Java 8+ users:</b> use {@link Long#divideUnsigned(long, long)} instead.
       *
       * @param dividend the dividend (numerator)
       * @param divisor the divisor (denominator)
       * @throws ArithmeticException if divisor is 0
       */
      public static long divide(long dividend, long divisor) {
        if (divisor < 0) { // i.e., divisor >= 2^63:
          if (compare(dividend, divisor) < 0) {
            return 0; // dividend < divisor
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 17.8K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/primitives/UnsignedInts.java

       *
       * <p><b>Java 8+ users:</b> use {@link Integer#divideUnsigned(int, int)} instead.
       *
       * @param dividend the dividend (numerator)
       * @param divisor the divisor (denominator)
       * @throws ArithmeticException if divisor is 0
       */
      public static int divide(int dividend, int divisor) {
        return (int) (toLong(dividend) / toLong(divisor));
      }
    
      /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sun Feb 09 16:22:33 UTC 2025
    - 13.8K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

        List<Callable<Integer>> l = new ArrayList<>();
        l.add(
            new Callable<Integer>() {
              @Override
              public Integer call() {
                throw new ArithmeticException("/ by zero");
              }
            });
        l.add(null);
        try {
          invokeAnyImpl(e, l, false, 0, NANOSECONDS);
          fail();
        } catch (NullPointerException success) {
        } finally {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 28K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/primitives/Ints.java

       *
       * <p><b>Note:</b> this method is now unnecessary and should be treated as deprecated. Use {@link
       * Math#toIntExact(long)} instead, but be aware that that method throws {@link
       * ArithmeticException} rather than {@link IllegalArgumentException}.
       *
       * @param value any value in the range of the {@code int} type
       * @return the {@code int} value that equals {@code value}
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 31.4K bytes
    - Viewed (0)
Back to top