- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 36 for dividend (0.05 sec)
-
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/src/com/google/common/primitives/UnsignedInts.java
public static int divide(int dividend, int divisor) { return (int) (toLong(dividend) / toLong(divisor)); } /** * Returns dividend % divisor, where the dividend and divisor are treated as unsigned 32-bit * quantities. * * <p><b>Java 8+ users:</b> use {@link Integer#remainderUnsigned(int, int)} instead. * * @param dividend the dividend (numerator) * @param divisor the divisor (denominator)
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 21:17:54 UTC 2024 - 13.7K bytes - Viewed (0) -
guava/src/com/google/common/primitives/UnsignedInts.java
public static int divide(int dividend, int divisor) { return (int) (toLong(dividend) / toLong(divisor)); } /** * Returns dividend % divisor, where the dividend and divisor are treated as unsigned 32-bit * quantities. * * <p><b>Java 8+ users:</b> use {@link Integer#remainderUnsigned(int, int)} instead. * * @param dividend the dividend (numerator) * @param divisor the divisor (denominator)
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 21:17:54 UTC 2024 - 13.7K 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) -
guava/src/com/google/common/math/BigIntegerMath.java
} } /** * Returns the result of dividing {@code p} by {@code q}, rounding using the specified {@code * RoundingMode}. * * @throws ArithmeticException if {@code q == 0}, or if {@code mode == UNNECESSARY} and {@code a} * is not an integer multiple of {@code b} */ @GwtIncompatible // TODO public static BigInteger divide(BigInteger p, BigInteger q, RoundingMode mode) {
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/src/com/google/common/math/LongMath.java
a >>= aTwos; // divide out all 2s 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.
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
a >>= aTwos; // divide out all 2s 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.
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 09 16:39:37 UTC 2024 - 45.2K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/Iterables.java
* @param iterable the iterable to return a partitioned view of * @param size the desired size of each partition (the last may be smaller) * @return an iterable of unmodifiable lists containing the elements of {@code iterable} divided * into partitions * @throws IllegalArgumentException if {@code size} is nonpositive */ public static <T extends @Nullable Object> Iterable<List<T>> partition(
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Apr 24 19:38:27 UTC 2024 - 42.8K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/math/IntMathTest.java
} boolean dividesEvenly = (p % q) == 0; try { assertEquals(p + "/" + q, p, IntMath.divide(p, q, UNNECESSARY) * q); assertTrue(p + "/" + q + " not expected to divide evenly", dividesEvenly); } catch (ArithmeticException e) { assertFalse(p + "/" + q + " expected to divide evenly", dividesEvenly); } } } } public void testZeroDivIsAlwaysZero() {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 23.1K bytes - Viewed (0)