Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 19 of 19 for saturatedAdd (0.08 sec)

  1. guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java

        long waitMicros =
            storedPermitsToWaitTime(this.storedPermits, storedPermitsToSpend)
                + (long) (freshPermits * stableIntervalMicros);
    
        this.nextFreeTicketMicros = LongMath.saturatedAdd(nextFreeTicketMicros, waitMicros);
        this.storedPermits -= storedPermitsToSpend;
        return returnValue;
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Apr 04 09:45:04 UTC 2023
    - 19.3K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/math/IntMathTest.java

        for (int a : ALL_INTEGER_CANDIDATES) {
          for (int b : ALL_INTEGER_CANDIDATES) {
            assertOperationEquals(
                a, b, "s+", saturatedCast(valueOf(a).add(valueOf(b))), IntMath.saturatedAdd(a, b));
          }
        }
      }
    
      @AndroidIncompatible // slow
      @GwtIncompatible // TODO
      public void testSaturatedSubtract() {
        for (int a : ALL_INTEGER_CANDIDATES) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/math/IntMathTest.java

        for (int a : ALL_INTEGER_CANDIDATES) {
          for (int b : ALL_INTEGER_CANDIDATES) {
            assertOperationEquals(
                a, b, "s+", saturatedCast(valueOf(a).add(valueOf(b))), IntMath.saturatedAdd(a, b));
          }
        }
      }
    
      @AndroidIncompatible // slow
      @GwtIncompatible // TODO
      public void testSaturatedSubtract() {
        for (int a : ALL_INTEGER_CANDIDATES) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/Multisets.java

          }
    
          @Override
          public boolean isEmpty() {
            return multiset1.isEmpty() && multiset2.isEmpty();
          }
    
          @Override
          public int size() {
            return IntMath.saturatedAdd(multiset1.size(), multiset2.size());
          }
    
          @Override
          public int count(@CheckForNull Object element) {
            return multiset1.count(element) + multiset2.count(element);
          }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 41.7K bytes
    - Viewed (0)
  5. guava/src/com/google/common/collect/Multisets.java

          }
    
          @Override
          public boolean isEmpty() {
            return multiset1.isEmpty() && multiset2.isEmpty();
          }
    
          @Override
          public int size() {
            return IntMath.saturatedAdd(multiset1.size(), multiset2.size());
          }
    
          @Override
          public int count(@CheckForNull Object element) {
            return multiset1.count(element) + multiset2.count(element);
          }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 41.5K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/ImmutableSortedMultiset.java

          if (maybeExpand && uniques * 4 > length * 3) {
            // lots of nonduplicated elements, expand the array by 50%
            sortedElements =
                Arrays.copyOf(sortedElements, IntMath.saturatedAdd(length, length / 2 + 1));
          }
          int[] sortedCounts = new int[sortedElements.length];
          for (int i = 0; i < length; i++) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 16 21:21:17 UTC 2024
    - 35.4K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/math/LongMathTest.java

        for (long a : ALL_LONG_CANDIDATES) {
          for (long b : ALL_LONG_CANDIDATES) {
            assertOperationEquals(
                a, b, "s+", saturatedCast(valueOf(a).add(valueOf(b))), LongMath.saturatedAdd(a, b));
          }
        }
      }
    
      @AndroidIncompatible // slow
      @GwtIncompatible // TODO
      public void testSaturatedSubtract() {
        for (long a : ALL_LONG_CANDIDATES) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  8. 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 saturatedAdd(long a, long b) {
        long naiveSum = a + b;
        if ((a ^ b) < 0 | (a ^ naiveSum) >= 0) {
          // If a and b have different signs or a has the same sign as the result then there was no
          // overflow, return.
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  9. android/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 saturatedAdd(long a, long b) {
        long naiveSum = a + b;
        if ((a ^ b) < 0 | (a ^ naiveSum) >= 0) {
          // If a and b have different signs or a has the same sign as the result then there was no
          // overflow, return.
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
Back to top