Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 63 for divider (0.18 sec)

  1. guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java

      // to the given dividend, so that we don't have half of our divisions being
      // trivial because the divisor is bigger than the dividend.
      // Using remainder here does not give us a uniform distribution but it should
      // not have a big impact on the measurement.
      private static long randomDivisor(long dividend) {
        long r = RANDOM_SOURCE.nextLong();
        if (dividend == -1) {
          return r;
        } else {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.3K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/primitives/UnsignedInts.java

        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)
       * @throws ArithmeticException if divisor is 0
       */
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 13.4K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java

        for (int i = 0; i < 1000000; i++) {
          long dividend = r.nextLong();
          long divisor = r.nextLong();
          // Test that the Euclidean property is preserved:
          assertThat(
                  dividend
                      - (divisor * UnsignedLongs.divide(dividend, divisor)
                          + UnsignedLongs.remainder(dividend, divisor)))
              .isEqualTo(0);
        }
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Fri Feb 09 15:36:17 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  4. 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);
        }
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 16:10:08 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/math/IntMath.java

        a >>= aTwos; // divide out all 2s
        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.
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 23.5K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/primitives/UnsignedLongs.java

       *
       * @param dividend the dividend (numerator)
       * @param divisor the divisor (denominator)
       * @throws ArithmeticException if divisor is 0
       * @since 11.0
       */
      public static long remainder(long dividend, long divisor) {
        if (divisor < 0) { // i.e., divisor >= 2^63:
          if (compare(dividend, divisor) < 0) {
            return dividend; // dividend < divisor
          } else {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 17.6K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/collect/TablesTransformValuesColumnTest.java

        return Tables.transformValues(table, DIVIDE_BY_2);
      }
    
      @Override
      protected Map<String, Integer> makePopulatedMap() {
        Table<String, Character, Integer> table = HashBasedTable.create();
        table.put("one", 'a', 1);
        table.put("two", 'a', 2);
        table.put("three", 'a', 3);
        table.put("four", 'b', 4);
        return Tables.transformValues(table, DIVIDE_BY_2).column('a');
      }
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Feb 19 20:34:55 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java

        for (int i = 0; i < 1000000; i++) {
          long dividend = r.nextLong();
          long divisor = r.nextLong();
          // Test that the Euclidean property is preserved:
          assertThat(
                  dividend
                      - (divisor * UnsignedLongs.divide(dividend, divisor)
                          + UnsignedLongs.remainder(dividend, divisor)))
              .isEqualTo(0);
        }
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Feb 09 15:36:17 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/math/LongMathTest.java

              long expected =
                  new BigDecimal(valueOf(p)).divide(new BigDecimal(valueOf(q)), 0, mode).longValue();
              long actual = LongMath.divide(p, q, mode);
              if (expected != actual) {
                failFormat("expected divide(%s, %s, %s) = %s; got %s", p, q, mode, expected, actual);
              }
            }
          }
        }
      }
    
      @GwtIncompatible // TODO
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Mar 04 20:15:57 GMT 2024
    - 32.5K bytes
    - Viewed (0)
  10. android/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java

      // to the given dividend, so that we don't have half of our divisions being
      // trivial because the divisor is bigger than the dividend.
      // Using remainder here does not give us a uniform distribution but it should
      // not have a big impact on the measurement.
      private static long randomDivisor(long dividend) {
        long r = RANDOM_SOURCE.nextLong();
        if (dividend == -1) {
          return r;
        } else {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.3K bytes
    - Viewed (0)
Back to top