Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 16 of 16 for checkedMultiply (0.25 sec)

  1. 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: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  2. 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: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 24.5K bytes
    - Viewed (0)
  3. 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: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  4. 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: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  5. 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: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 22 21:19:52 UTC 2024
    - 34K bytes
    - Viewed (0)
  6. 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: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 22 21:19:52 UTC 2024
    - 34K bytes
    - Viewed (0)
Back to top