- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 328 for divide (0.05 sec)
-
guava/src/com/google/common/math/BigIntegerMath.java
*/ sqrt0 = sqrtApproxWithDoubles(x.shiftRight(shift)).shiftLeft(shift >> 1); } BigInteger sqrt1 = sqrt0.add(x.divide(sqrt0)).shiftRight(1); if (sqrt0.equals(sqrt1)) { return sqrt0; } do { sqrt0 = sqrt1; sqrt1 = sqrt0.add(x.divide(sqrt0)).shiftRight(1); } while (sqrt1.compareTo(sqrt0) < 0); return sqrt0; } @GwtIncompatible // TODO
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 16 17:21:56 UTC 2024 - 18.8K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/QuantilesAlgorithm.java
} private double singleQuantileFromSorted(int index, int scale, double[] dataset) { long numerator = (long) index * (dataset.length - 1); int positionFloor = (int) LongMath.divide(numerator, scale, RoundingMode.DOWN); int remainder = (int) (numerator - positionFloor * scale); if (remainder == 0) { return dataset[positionFloor]; } else {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Feb 01 16:30:37 UTC 2022 - 7.1K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/math/LongMathRoundingBenchmark.java
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 2.6K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/math/IntMathRoundingBenchmark.java
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 2.6K bytes - Viewed (0) -
android/guava/src/com/google/common/primitives/UnsignedLongs.java
public static long divide(long dividend, long divisor) { if (divisor < 0) { // i.e., divisor >= 2^63: if (compare(dividend, divisor) < 0) { return 0; // dividend < divisor } else { return 1; // dividend >= divisor } } // Optimization - use signed division if dividend < 2^63 if (dividend >= 0) { return dividend / divisor; } /*
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Aug 12 21:04:48 UTC 2024 - 17.6K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java
Random r = new Random(0L); for (int i = 0; i < 1000000; i++) { int dividend = r.nextInt(); int divisor = r.nextInt(); // Test that the Euclidean property is preserved: assertThat( dividend - (divisor * UnsignedInts.divide(dividend, divisor) + UnsignedInts.remainder(dividend, divisor))) .isEqualTo(0); } }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 02:56:12 UTC 2024 - 12.5K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/math/QuantilesTest.java
// ceil(199*index/2). if (index % 2 == 0) { int position = IntMath.divide(199 * index, 2, UNNECESSARY); return PSEUDORANDOM_DATASET_SORTED.get(position); } else { int positionFloor = IntMath.divide(199 * index, 2, FLOOR); int positionCeil = IntMath.divide(199 * index, 2, CEILING); double lowerValue = PSEUDORANDOM_DATASET_SORTED.get(positionFloor);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Sep 06 17:04:31 UTC 2023 - 29.7K bytes - Viewed (0) -
src/cmd/asm/internal/asm/expr_test.go
} } type badExprTest struct { input string error string // Empty means no error. } var badExprTests = []badExprTest{ {"0/0", "division by zero"}, {"3/0", "division by zero"}, {"(1<<63)/0", "divide of value with high bit set"}, {"3%0", "modulo by zero"}, {"(1<<63)%0", "modulo of value with high bit set"}, {"3<<-4", "negative left shift count"}, {"3<<(1<<63)", "negative left shift count"},
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Tue Aug 29 07:48:38 UTC 2023 - 3.2K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java
result *= i; } return BigInteger.valueOf(result); } /* * We want each multiplication to have both sides with approximately the same number of digits. * Currently, we just divide the range in half. */ int mid = (n1 + n2) >>> 1; return oldSlowFactorial(n1, mid).multiply(oldSlowFactorial(mid, n2)); } @Benchmark int slowFactorial(int reps) { int tmp = 0;
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
result *= i; } return BigInteger.valueOf(result); } /* * We want each multiplication to have both sides with approximately the same number of digits. * Currently, we just divide the range in half. */ int mid = (n1 + n2) >>> 1; return oldSlowFactorial(n1, mid).multiply(oldSlowFactorial(mid, n2)); } @Benchmark int slowFactorial(int reps) { int tmp = 0;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Aug 19 16:21:24 UTC 2024 - 3.4K bytes - Viewed (0)