- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 10 for saturatedAdd (0.32 seconds)
-
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;
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Feb 23 19:19:10 GMT 2026 - 81.4K bytes - Click Count (0) -
android/guava/src/com/google/common/math/IntMath.java
* {@code Integer.MAX_VALUE} or {@code Integer.MIN_VALUE} is returned, respectively. * * @since 20.0 */ public static int saturatedAdd(int a, int b) { return Ints.saturatedCast((long) a + b); } /** * Returns the difference of {@code a} and {@code b} unless it would overflow or underflow inCreated: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Jan 29 22:14:05 GMT 2026 - 26.1K bytes - Click Count (0) -
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;
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Feb 23 19:19:10 GMT 2026 - 83K bytes - Click Count (0) -
android/guava/src/com/google/common/graph/AbstractNetwork.java
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Wed Mar 11 01:10:31 GMT 2026 - 10K bytes - Click Count (0) -
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(),
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Feb 23 19:19:10 GMT 2026 - 36.8K bytes - Click Count (0) -
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(),
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Feb 23 19:19:10 GMT 2026 - 36.4K bytes - Click Count (0) -
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.
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Mar 09 23:01:02 GMT 2026 - 46.8K bytes - Click Count (0) -
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());Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Feb 23 16:38:09 GMT 2026 - 42.1K bytes - Click Count (0) -
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());Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Feb 23 16:38:09 GMT 2026 - 42.5K bytes - Click Count (0) -
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) {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Oct 30 14:15:36 GMT 2025 - 31.4K bytes - Click Count (0)