Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for saturatedPow (0.09 sec)

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

      public void testSaturatedPow() {
        for (int a : ALL_INTEGER_CANDIDATES) {
          for (int b : EXPONENTS) {
            assertOperationEquals(
                a, b, "s^", saturatedCast(valueOf(a).pow(b)), IntMath.saturatedPow(a, b));
          }
        }
      }
    
      private static final BigInteger MAX_INT = BigInteger.valueOf(Integer.MAX_VALUE);
      private static final BigInteger MIN_INT = BigInteger.valueOf(Integer.MIN_VALUE);
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 24.1K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/math/LongMathTest.java

      public void testSaturatedPow() {
        for (long a : ALL_LONG_CANDIDATES) {
          for (int b : EXPONENTS) {
            assertOperationEquals(
                a, b, "s^", saturatedCast(valueOf(a).pow(b)), LongMath.saturatedPow(a, b));
          }
        }
      }
    
      private void assertOperationEquals(long a, long b, String op, long expected, long actual) {
        if (expected != actual) {
    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

       *
       * @since 20.0
       */
      // Whenever both tests are cheap and functional, it's faster to use &, | instead of &&, ||
      @SuppressWarnings("ShortCircuitBoolean")
      public static long saturatedPow(long b, int k) {
        checkNonNegative("exponent", k);
        if (b >= -2 & b <= 2) {
          switch ((int) b) {
            case 0:
              return (k == 0) ? 1 : 0;
            case 1:
              return 1;
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Fri Aug 29 16:20:07 UTC 2025
    - 46.8K bytes
    - Viewed (0)
Back to top