Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for checkedMultiply (0.31 sec)

  1. guava/src/com/google/common/math/LongMath.java

         */
        if (leadingZeros > Long.SIZE + 1) {
          return a * b;
        }
        checkNoOverflow(leadingZeros >= Long.SIZE, "checkedMultiply", a, b);
        checkNoOverflow(a >= 0 | b != Long.MIN_VALUE, "checkedMultiply", a, b);
        long result = a * b;
        checkNoOverflow(a == 0 || result / a == b, "checkedMultiply", a, b);
        return result;
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/math/LongMath.java

         */
        if (leadingZeros > Long.SIZE + 1) {
          return a * b;
        }
        checkNoOverflow(leadingZeros >= Long.SIZE, "checkedMultiply", a, b);
        checkNoOverflow(a >= 0 | b != Long.MIN_VALUE, "checkedMultiply", a, b);
        long result = a * b;
        checkNoOverflow(a == 0 || result / a == b, "checkedMultiply", a, b);
        return result;
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  3. 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 Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/TopKSelector.java

        this.k = k;
        checkArgument(k >= 0, "k (%s) must be >= 0", k);
        checkArgument(k <= Integer.MAX_VALUE / 2, "k (%s) must be <= Integer.MAX_VALUE / 2", k);
        this.buffer = (T[]) new Object[IntMath.checkedMultiply(k, 2)];
        this.bufferSize = 0;
        this.threshold = null;
      }
    
      /**
       * Adds {@code elem} as a candidate for the top {@code k} elements. This operation takes amortized
       * O(1) time.
       */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  5. 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 Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/MinMaxPriorityQueue.java

      private int calculateNewCapacity() {
        int oldCapacity = queue.length;
        int newCapacity =
            (oldCapacity < 64) ? (oldCapacity + 1) * 2 : IntMath.checkedMultiply(oldCapacity / 2, 3);
        return capAtMaximumSize(newCapacity, maximumSize);
      }
    
      /** There's no reason for the queueSize to ever be more than maxSize + 1 */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 34.1K bytes
    - Viewed (0)
  7. 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 Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/MinMaxPriorityQueue.java

      private int calculateNewCapacity() {
        int oldCapacity = queue.length;
        int newCapacity =
            (oldCapacity < 64) ? (oldCapacity + 1) * 2 : IntMath.checkedMultiply(oldCapacity / 2, 3);
        return capAtMaximumSize(newCapacity, maximumSize);
      }
    
      /** There's no reason for the queueSize to ever be more than maxSize + 1 */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 34.1K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/hash/BloomFilter.java

          dataLength = din.readInt();
    
          Strategy strategy = BloomFilterStrategies.values()[strategyOrdinal];
    
          LockFreeBitArray dataArray = new LockFreeBitArray(LongMath.checkedMultiply(dataLength, 64L));
          for (int i = 0; i < dataLength; i++) {
            dataArray.putData(i, din.readLong());
          }
    
          return new BloomFilter<>(dataArray, numHashFunctions, funnel, strategy);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 23 16:45:30 UTC 2024
    - 26.6K bytes
    - Viewed (0)
Back to top