Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 108 for overflow (0.72 sec)

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

       *
       * <p>{@link #pow} may be faster, but does not check for overflow.
       *
       * @throws ArithmeticException if {@code b} to the {@code k}th power overflows in signed {@code
       *     int} arithmetic
       */
      public static int checkedPow(int b, int k) {
        checkNonNegative("exponent", k);
        switch (b) {
          case 0:
            return (k == 0) ? 1 : 0;
          case 1:
            return 1;
          case (-1):
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 23.5K bytes
    - Viewed (0)
  2. guava/src/com/google/common/math/IntMath.java

       *
       * <p>{@link #pow} may be faster, but does not check for overflow.
       *
       * @throws ArithmeticException if {@code b} to the {@code k}th power overflows in signed {@code
       *     int} arithmetic
       */
      public static int checkedPow(int b, int k) {
        checkNonNegative("exponent", k);
        switch (b) {
          case 0:
            return (k == 0) ? 1 : 0;
          case 1:
            return 1;
          case (-1):
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 23.5K bytes
    - Viewed (0)
  3. guava/src/com/google/common/math/MathPreconditions.java

        if (!condition) {
          throw new ArithmeticException("overflow: " + methodName + "(" + a + ", " + b + ")");
        }
      }
    
      static void checkNoOverflow(boolean condition, String methodName, long a, long b) {
        if (!condition) {
          throw new ArithmeticException("overflow: " + methodName + "(" + a + ", " + b + ")");
        }
      }
    
      private MathPreconditions() {}
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Jun 15 20:59:00 UTC 2022
    - 3.3K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/math/MathPreconditions.java

        if (!condition) {
          throw new ArithmeticException("overflow: " + methodName + "(" + a + ", " + b + ")");
        }
      }
    
      static void checkNoOverflow(boolean condition, String methodName, long a, long b) {
        if (!condition) {
          throw new ArithmeticException("overflow: " + methodName + "(" + a + ", " + b + ")");
        }
      }
    
      private MathPreconditions() {}
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Jun 15 20:59:00 UTC 2022
    - 3.3K bytes
    - Viewed (0)
  5. guava/src/com/google/common/math/LongMath.java

          // overflow, return.
          return naiveSum;
        }
        // we did over/under flow, if the sign is negative we should return MAX otherwise MIN
        return Long.MAX_VALUE + ((naiveSum >>> (Long.SIZE - 1)) ^ 1);
      }
    
      /**
       * Returns the difference of {@code a} and {@code b} unless it would overflow or underflow in
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 44.6K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/collect/Collections2Test.java

      }
    
      public void testOrderedPermutationSetSizeOverflow() {
        // 12 elements won't overflow
        assertEquals(
            479001600 /*12!*/,
            Collections2.orderedPermutations(newArrayList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))
                .size());
        // 13 elements overflow an int
        assertEquals(
            Integer.MAX_VALUE,
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 21 10:16:44 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  7. guava/src/com/google/common/util/concurrent/AbstractTransformFuture.java

         * might not run some of its listeners. The likely result is that the app will hang. (And of
         * course stack overflows are bad news in general. For example, we may have overflowed in the
         * middle of defining a class. If so, that class will never be loadable in this process.) The
         * best we can do (since logging may overflow the stack) is to let the error propagate. Because
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 01 21:46:34 UTC 2024
    - 10.6K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java

          assertThat(UnsignedInts.parseUnsignedInt(maxAsString, radix)).isEqualTo(-1);
    
          try {
            // tests that we get exception where an overflow would occur.
            long overflow = 1L << 32;
            String overflowAsString = Long.toString(overflow, radix);
            UnsignedInts.parseUnsignedInt(overflowAsString, radix);
            fail();
          } catch (NumberFormatException expected) {
          }
        }
      }
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Feb 06 16:10:08 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java

          assertThat(UnsignedLongs.parseUnsignedLong(maxAsString, radix)).isEqualTo(max.longValue());
    
          try {
            // tests that we get exception where an overflow would occur.
            BigInteger overflow = max.add(ONE);
            String overflowAsString = overflow.toString(radix);
            UnsignedLongs.parseUnsignedLong(overflowAsString, radix);
            fail();
          } catch (NumberFormatException expected) {
          }
        }
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri Feb 09 15:36:17 UTC 2024
    - 13.2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/math/LongMath.java

          // overflow, return.
          return naiveSum;
        }
        // we did over/under flow, if the sign is negative we should return MAX otherwise MIN
        return Long.MAX_VALUE + ((naiveSum >>> (Long.SIZE - 1)) ^ 1);
      }
    
      /**
       * Returns the difference of {@code a} and {@code b} unless it would overflow or underflow in
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 44.6K bytes
    - Viewed (0)
Back to top