Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for ArithmeticException (0.11 sec)

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

            // unless all n are fair game with this k
            assertThrows(
                ArithmeticException.class,
                () -> simpleBinomial(LongMath.biggestSimpleBinomials[k] + 1, k));
          }
        }
        int k = LongMath.biggestSimpleBinomials.length;
        assertThrows(ArithmeticException.class, () -> simpleBinomial(2 * k, k));
      }
    
      @AndroidIncompatible // slow
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/math/DoubleMathTest.java

            assertTrue(isInBounds);
          } catch (ArithmeticException e) {
            assertFalse(isInBounds);
          }
        }
      }
    
      @GwtIncompatible // DoubleMath.roundToInt(double, RoundingMode)
      public void testRoundExactFractionalDoubleToIntFails() {
        for (double d : FRACTIONAL_DOUBLE_CANDIDATES) {
          assertThrows(ArithmeticException.class, () -> DoubleMath.roundToInt(d, UNNECESSARY));
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 27.3K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/math/DoubleMathTest.java

            assertTrue(isInBounds);
          } catch (ArithmeticException e) {
            assertFalse(isInBounds);
          }
        }
      }
    
      @GwtIncompatible // DoubleMath.roundToInt(double, RoundingMode)
      public void testRoundExactFractionalDoubleToIntFails() {
        for (double d : FRACTIONAL_DOUBLE_CANDIDATES) {
          assertThrows(ArithmeticException.class, () -> DoubleMath.roundToInt(d, UNNECESSARY));
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 27.3K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/math/IntMathTest.java

        for (int x : POSITIVE_INTEGER_CANDIDATES) {
          for (int m : NEGATIVE_INTEGER_CANDIDATES) {
            assertThrows(ArithmeticException.class, () -> IntMath.mod(x, m));
          }
        }
      }
    
      public void testModZeroModulusFails() {
        for (int x : ALL_INTEGER_CANDIDATES) {
          assertThrows(ArithmeticException.class, () -> IntMath.mod(x, 0));
        }
      }
    
      public void testGCD() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/math/IntMathTest.java

        for (int x : POSITIVE_INTEGER_CANDIDATES) {
          for (int m : NEGATIVE_INTEGER_CANDIDATES) {
            assertThrows(ArithmeticException.class, () -> IntMath.mod(x, m));
          }
        }
      }
    
      public void testModZeroModulusFails() {
        for (int x : ALL_INTEGER_CANDIDATES) {
          assertThrows(ArithmeticException.class, () -> IntMath.mod(x, 0));
        }
      }
    
      public void testGCD() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  6. guava/src/com/google/common/math/LongMath.java

       *
       * @throws IllegalArgumentException if {@code x <= 0}
       * @throws ArithmeticException of the next-higher power of two is not representable as a {@code
       *     long}, i.e. when {@code x > 2^62}
       * @since 20.0
       */
      public static long ceilingPowerOfTwo(long x) {
        checkPositive("x", x);
        if (x > MAX_SIGNED_POWER_OF_TWO) {
          throw new ArithmeticException("ceilingPowerOfTwo(" + x + ") is not representable as a long");
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/math/LongMath.java

       *
       * @throws IllegalArgumentException if {@code x <= 0}
       * @throws ArithmeticException of the next-higher power of two is not representable as a {@code
       *     long}, i.e. when {@code x > 2^62}
       * @since 20.0
       */
      public static long ceilingPowerOfTwo(long x) {
        checkPositive("x", x);
        if (x > MAX_SIGNED_POWER_OF_TWO) {
          throw new ArithmeticException("ceilingPowerOfTwo(" + x + ") is not representable as a long");
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  8. guava/src/com/google/common/math/BigIntegerMath.java

      }
    
      /**
       * Returns the base-2 logarithm of {@code x}, rounded according to the specified rounding mode.
       *
       * @throws IllegalArgumentException if {@code x <= 0}
       * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
       *     is not a power of two
       */
      @SuppressWarnings("fallthrough")
      // TODO(kevinb): remove after this warning is disabled globally
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 16 17:21:56 UTC 2024
    - 18.8K bytes
    - Viewed (0)
  9. 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 Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 10.6K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java

            }
          }
        }
      }
    
      public void testDivideByZeroThrows() {
        for (long a : TEST_LONGS) {
          assertThrows(
              ArithmeticException.class,
              () -> UnsignedLong.fromLongBits(a).dividedBy(UnsignedLong.ZERO));
        }
      }
    
      public void testMod() {
        for (long a : TEST_LONGS) {
          for (long b : TEST_LONGS) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 02:56:12 UTC 2024
    - 10.4K bytes
    - Viewed (0)
Back to top