- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 14 for LongMath (0.06 sec)
-
android/guava/src/com/google/common/math/LongMath.java
* values, see {@link com.google.common.primitives.Longs}. * * @author Louis Wasserman * @since 11.0 */ @GwtCompatible(emulated = true) @ElementTypesAreNonnullByDefault public final class LongMath { @VisibleForTesting static final long MAX_SIGNED_POWER_OF_TWO = 1L << (Long.SIZE - 2); /** * Returns the smallest power of two greater than or equal to {@code x}. This is equivalent to
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 09 16:39:37 UTC 2024 - 45.2K bytes - Viewed (0) -
guava/src/com/google/common/math/LongMath.java
* values, see {@link com.google.common.primitives.Longs}. * * @author Louis Wasserman * @since 11.0 */ @GwtCompatible(emulated = true) @ElementTypesAreNonnullByDefault public final class LongMath { @VisibleForTesting static final long MAX_SIGNED_POWER_OF_TWO = 1L << (Long.SIZE - 2); /** * Returns the smallest power of two greater than or equal to {@code x}. This is equivalent to
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 09 16:39:37 UTC 2024 - 45.2K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/LongMathTest.java
for (int i = 0; i < LongMath.powersOf10.length; i++) { assertEquals(LongMath.checkedPow(10, i), LongMath.powersOf10[i]); } assertThrows( ArithmeticException.class, () -> LongMath.checkedPow(10, LongMath.powersOf10.length)); } @GwtIncompatible // TODO public void testConstantsHalfPowersOf10() { for (int i = 0; i < LongMath.halfPowersOf10.length; i++) { assertEquals(
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 15:00:32 UTC 2024 - 30.6K bytes - Viewed (0) -
guava/src/com/google/common/math/BigIntegerMath.java
int startingNumber = LongMath.factorials.length; long product = LongMath.factorials[startingNumber - 1]; // Strip off 2s from this value. int shift = Long.numberOfTrailingZeros(product); product >>= shift; // Use floor(log2(num)) + 1 to prevent overflow of multiplication. int productBits = LongMath.log2(product, FLOOR) + 1; int bits = LongMath.log2(startingNumber, FLOOR) + 1;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 16 17:21:56 UTC 2024 - 18.8K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java
private static BigInteger oldSlowFactorial(int n) { if (n <= 20) { return BigInteger.valueOf(LongMath.factorial(n)); } else { int k = 20; return BigInteger.valueOf(LongMath.factorial(k)).multiply(oldSlowFactorial(k, n)); } } /** Returns the product of {@code n1} exclusive through {@code n2} inclusive. */
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Aug 19 16:21:24 UTC 2024 - 3.4K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java
private static BigInteger oldSlowFactorial(int n) { if (n <= 20) { return BigInteger.valueOf(LongMath.factorial(n)); } else { int k = 20; return BigInteger.valueOf(LongMath.factorial(k)).multiply(oldSlowFactorial(k, n)); } } /** Returns the product of {@code n1} exclusive through {@code n2} inclusive. */
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Aug 19 16:21:24 UTC 2024 - 3.4K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/Streams.java
import static java.lang.Math.min; import static java.util.Objects.requireNonNull; import com.google.common.annotations.Beta; import com.google.common.annotations.GwtCompatible; import com.google.common.math.LongMath; import com.google.errorprone.annotations.InlineMe; import com.google.errorprone.annotations.InlineMeValidationDisabled; import java.util.ArrayDeque; import java.util.Collection; import java.util.Deque;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Thu Oct 31 14:20:11 UTC 2024 - 37.4K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/IntMathTest.java
for (int i = 0; i < 100000; i++) { assertEquals(LongMath.isPrime(i), IntMath.isPrime(i)); } // Then check 1000 deterministic pseudo-random int values. Random rand = new Random(1); for (int i = 0; i < 1000; i++) { int n = rand.nextInt(Integer.MAX_VALUE); assertEquals(LongMath.isPrime(n), IntMath.isPrime(n)); } }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 23.1K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/math/IntMathTest.java
for (int i = 0; i < 100000; i++) { assertEquals(LongMath.isPrime(i), IntMath.isPrime(i)); } // Then check 1000 deterministic pseudo-random int values. Random rand = new Random(1); for (int i = 0; i < 1000; i++) { int n = rand.nextInt(Integer.MAX_VALUE); assertEquals(LongMath.isPrime(n), IntMath.isPrime(n)); } }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 23.1K bytes - Viewed (0) -
android/guava/src/com/google/common/cache/CacheStats.java
* the License. */ package com.google.common.cache; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.math.LongMath.saturatedAdd; import static com.google.common.math.LongMath.saturatedSubtract; import static java.lang.Math.max; import com.google.common.annotations.GwtCompatible; import com.google.common.base.MoreObjects; import com.google.common.base.Objects;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 19:07:49 UTC 2024 - 12.6K bytes - Viewed (0)