Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 61 for divider (5.12 sec)

  1. guava-testlib/src/com/google/common/testing/CollectorTester.java

      }
    
      /**
       * Verifies that the specified expected result is always produced by collecting the specified
       * inputs, regardless of how the elements are divided.
       */
      @SafeVarargs
      @CanIgnoreReturnValue
      @SuppressWarnings("nullness") // TODO(cpovirk): Remove after we fix whatever the bug is.
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 6.5K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/math/Quantiles.java

          // non-negative int, we can do long-arithmetic on index * (dataset.length - 1) / scale to get
          // a rounded ratio and a remainder which can be expressed as ints, without risk of overflow:
          int quotient = (int) LongMath.divide(numerator, scale, RoundingMode.DOWN);
          int remainder = (int) (numerator - (long) quotient * scale);
          selectInPlace(quotient, dataset, 0, dataset.length - 1);
          if (remainder == 0) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri May 12 17:02:53 GMT 2023
    - 29.9K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/hash/BloomFilterTest.java

      public void testBitSize() {
        double fpp = 0.03;
        for (int i = 1; i < 10000; i++) {
          long numBits = BloomFilter.optimalNumOfBits(i, fpp);
          int arraySize = Ints.checkedCast(LongMath.divide(numBits, 64, RoundingMode.CEILING));
          assertEquals(
              arraySize * Long.SIZE,
              BloomFilter.create(Funnels.unencodedCharsFunnel(), i, fpp).bitSize());
        }
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Nov 09 22:49:56 GMT 2023
    - 21.3K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/collect/TableCollectionTest.java

          table.put('a', "two", 2);
          table.put('a', "three", 3);
          table.put('b', "four", 4);
          return table.row('a');
        }
      }
    
      static final Function<@Nullable Integer, @Nullable Integer> DIVIDE_BY_2 =
          new Function<@Nullable Integer, @Nullable Integer>() {
            @Override
            public @Nullable Integer apply(@Nullable Integer input) {
              return (input == null) ? null : input / 2;
            }
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Feb 19 20:34:55 GMT 2024
    - 35.3K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. android/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 May 03 12:43:13 GMT 2024
    - Last Modified: Mon Feb 19 20:34:55 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  8. 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() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 24.5K bytes
    - Viewed (0)
  9. guava-tests/benchmark/com/google/common/math/BigIntegerMathRoundingBenchmark.java

          int j = i & ARRAY_MASK;
          tmp += BigIntegerMath.sqrt(positive[j], mode).intValue();
        }
        return tmp;
      }
    
      @Benchmark
      int divide(int reps) {
        int tmp = 0;
        for (int i = 0; i < reps; i++) {
          int j = i & ARRAY_MASK;
          tmp += BigIntegerMath.divide(nonzero1[j], nonzero2[j], mode).intValue();
        }
        return tmp;
      }
    
      @Benchmark
      long roundToDouble(int reps) {
        long tmp = 0;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Jun 30 13:06:20 GMT 2020
    - 2.8K bytes
    - Viewed (0)
  10. 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)
Back to top