Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for checkedMultiply (0.17 sec)

  1. android/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java

            try {
              int unused = IntMath.checkedMultiply(a, b);
              return true;
            } catch (ArithmeticException e) {
              return false;
            }
          }
    
          @Override
          public boolean noMulOverflow(long a, long b) {
            try {
              long unused = LongMath.checkedMultiply(a, b);
              return true;
            } catch (ArithmeticException e) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Jul 14 14:44:08 UTC 2025
    - 6.9K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/math/LongMathTest.java

            boolean expectedSuccess = fitsInLong(expectedResult);
            try {
              assertEquals(a * b, LongMath.checkedMultiply(a, b));
              assertTrue(expectedSuccess);
            } catch (ArithmeticException e) {
              if (expectedSuccess) {
                failFormat(
                    "expected checkedMultiply(%s, %s) = %s; got ArithmeticException",
                    a, b, expectedResult);
              }
            }
          }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 31.4K bytes
    - Viewed (0)
  3. guava/src/com/google/common/math/LongMath.java

          }
        }
        long accum = 1;
        while (true) {
          switch (k) {
            case 0:
              return accum;
            case 1:
              return checkedMultiply(accum, b);
            default:
              if ((k & 1) != 0) {
                accum = checkedMultiply(accum, b);
              }
              k >>= 1;
              if (k > 0) {
                checkNoOverflow(
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Fri Aug 29 16:20:07 UTC 2025
    - 46.8K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/math/IntMathTest.java

            BigInteger expectedResult = valueOf(a).multiply(valueOf(b));
            boolean expectedSuccess = fitsInInt(expectedResult);
            try {
              assertEquals(a * b, IntMath.checkedMultiply(a, b));
              assertTrue(expectedSuccess);
            } catch (ArithmeticException e) {
              assertFalse(expectedSuccess);
            }
          }
        }
      }
    
      public void testCheckedPow() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 24.1K bytes
    - Viewed (0)
Back to top