Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for saturatedAdd (0.07 sec)

  1. android/guava/src/com/google/common/cache/CacheStats.java

        return new CacheStats(
            saturatedAdd(hitCount, other.hitCount),
            saturatedAdd(missCount, other.missCount),
            saturatedAdd(loadSuccessCount, other.loadSuccessCount),
            saturatedAdd(loadExceptionCount, other.loadExceptionCount),
            saturatedAdd(totalLoadTime, other.totalLoadTime),
            saturatedAdd(evictionCount, other.evictionCount));
      }
    
      @Override
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue Jul 08 18:32:10 UTC 2025
    - 12.6K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/Streams.java

          isParallel |= stream.isParallel();
          Spliterator<? extends T> splitr = stream.spliterator();
          splitrsBuilder.add(splitr);
          characteristics &= splitr.characteristics();
          estimatedSize = LongMath.saturatedAdd(estimatedSize, splitr.estimateSize());
        }
        return StreamSupport.stream(
                CollectSpliterators.flatMap(
                    splitrsBuilder.build().spliterator(),
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 37K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/Lists.java

        OnePlusArrayList(@ParametricNullness E first, E[] rest) {
          this.first = first;
          this.rest = checkNotNull(rest);
        }
    
        @Override
        public int size() {
          return IntMath.saturatedAdd(rest.length, 1);
        }
    
        @Override
        @ParametricNullness
        public E get(int index) {
          // check explicitly so the IOOBE will have the right message
          checkElementIndex(index, size());
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 42.2K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/Sets.java

    import static com.google.common.base.Preconditions.checkNotNull;
    import static com.google.common.collect.CollectPreconditions.checkNonnegative;
    import static com.google.common.math.IntMath.saturatedAdd;
    import static java.lang.Math.max;
    import static java.lang.Math.min;
    import static java.util.Arrays.asList;
    
    import com.google.common.annotations.GwtCompatible;
    import com.google.common.annotations.GwtIncompatible;
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 81.6K bytes
    - Viewed (0)
  5. 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 Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 24.1K bytes
    - Viewed (0)
  6. 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 Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 31.4K bytes
    - Viewed (0)
  7. 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 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