- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 38 for Gcd (0.13 sec)
-
guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 3.2K bytes - Viewed (0) -
guava/src/com/google/common/math/IntMath.java
int bTwos = Integer.numberOfTrailingZeros(b); b >>= bTwos; // divide out all 2s while (a != b) { // both a, b are odd // The key to the binary GCD algorithm is as follows: // Both a and b are odd. Assume a > b; then gcd(a - b, b) = gcd(a, b). // But in gcd(a - b, b), a - b is even and b is odd, so we can divide out powers of two. // We bend over backwards to avoid branching, adapting a technique from
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Feb 07 17:50:39 UTC 2024 - 23.5K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/LongMathTest.java
assertEquals(valueOf(a).gcd(valueOf(b)), valueOf(LongMath.gcd(a, b))); } } } @GwtIncompatible // TODO public void testGCDZero() { for (long a : POSITIVE_LONG_CANDIDATES) { assertEquals(a, LongMath.gcd(a, 0)); assertEquals(a, LongMath.gcd(0, a)); } assertEquals(0, LongMath.gcd(0, 0)); } @GwtIncompatible // TODO
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Mon Mar 04 20:15:57 UTC 2024 - 32.5K bytes - Viewed (0) -
android/guava/src/com/google/common/math/LongMath.java
int bTwos = Long.numberOfTrailingZeros(b); b >>= bTwos; // divide out all 2s while (a != b) { // both a, b are odd // The key to the binary GCD algorithm is as follows: // Both a and b are odd. Assume a > b; then gcd(a - b, b) = gcd(a, b). // But in gcd(a - b, b), a - b is even and b is odd, so we can divide out powers of two. // We bend over backwards to avoid branching, adapting a technique from
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Feb 07 17:50:39 UTC 2024 - 44.6K bytes - Viewed (0) -
guava/src/com/google/common/math/LongMath.java
int bTwos = Long.numberOfTrailingZeros(b); b >>= bTwos; // divide out all 2s while (a != b) { // both a, b are odd // The key to the binary GCD algorithm is as follows: // Both a and b are odd. Assume a > b; then gcd(a - b, b) = gcd(a, b). // But in gcd(a - b, b), a - b is even and b is odd, so we can divide out powers of two. // We bend over backwards to avoid branching, adapting a technique from
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Feb 07 17:50:39 UTC 2024 - 44.6K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java
return DoubleMath.factorial(n); } @Override public int gcdInt(int a, int b) { return IntMath.gcd(a, b); } @Override public long gcdLong(long a, long b) { return LongMath.gcd(a, b); } @Override public long binomialCoefficient(int n, int k) { return LongMath.binomial(n, k); } @Override
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 6.9K bytes - Viewed (0) -
src/math/big/prime.go
// An extra strong Lucas pseudoprime to base b is a composite n = 2^r s + Jacobi(Δ, n), // where s is odd and gcd(n, 2*Δ) = 1, such that either (i) U_s ≡ 0 mod n and V_s ≡ ±2 mod n, // or (ii) V_{2^t s} ≡ 0 mod n for some 0 ≤ t < r-1. // // We know gcd(n, Δ) = 1 or else we'd have found Jacobi(d, n) == 0 above. // We know gcd(n, 2) = 1 because n is odd. // // Arrange s = (n - Jacobi(Δ, n)) / 2^r = (n+1) / 2^r.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Nov 02 14:43:52 UTC 2022 - 10.4K bytes - Viewed (0) -
src/internal/coverage/cfile/emitdata_test.go
t.Fatalf("mkdir failed: %v", err) } return d } // updateGoCoverDir updates the specified environment 'env' to set // GOCOVERDIR to 'gcd' (if setGoCoverDir is TRUE) or removes // GOCOVERDIR from the environment (if setGoCoverDir is false). func updateGoCoverDir(env []string, gcd string, setGoCoverDir bool) []string { rv := []string{} found := false for _, v := range env { if strings.HasPrefix(v, "GOCOVERDIR=") {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 18:42:28 UTC 2024 - 16.3K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/math/LongMathBenchmark.java
int mod(int reps) { int tmp = 0; for (int i = 0; i < reps; i++) { int j = i & ARRAY_MASK; tmp += LongMath.mod(longs[j], positive[j]); } return tmp; } @Benchmark int gCD(int reps) { int tmp = 0; for (int i = 0; i < reps; i++) { int j = i & ARRAY_MASK; tmp += LongMath.mod(nonnegative[j], positive[j]); } return tmp; } @Benchmark
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 3.5K bytes - Viewed (0) -
src/math/big/int.go
} return z } // GCD sets z to the greatest common divisor of a and b and returns z. // If x or y are not nil, GCD sets their value such that z = a*x + b*y. // // a and b may be positive, zero or negative. (Before Go 1.14 both had // to be > 0.) Regardless of the signs of a and b, z is always >= 0. // // If a == b == 0, GCD sets z = x = y = 0. // // If a == 0 and b != 0, GCD sets z = |b|, x = 0, y = sign(b) * 1. //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 14 17:02:38 UTC 2024 - 33.1K bytes - Viewed (0)