Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 869 for multiply (0.19 sec)

  1. guava-tests/benchmark/com/google/common/collect/SetContainsBenchmark.java

    import java.util.Set;
    
    /**
     * A microbenchmark that tests the performance of contains() on various Set implementations.
     *
     * @author Kevin Bourrillion
     */
    public class SetContainsBenchmark {
      // Start at 4.88 then multiply by 2*2^phi <evil cackle> - The goal is be uniform
      // yet visit a variety of "values-relative-to-the-next-power-of-2"
      @Param({"5", "30", "180", "1100", "6900", "43000", "260000"}) // "1600000", "9800000"
      private int size;
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.4K bytes
    - Viewed (0)
  2. android/guava-tests/benchmark/com/google/common/collect/SetContainsBenchmark.java

    import java.util.Set;
    
    /**
     * A microbenchmark that tests the performance of contains() on various Set implementations.
     *
     * @author Kevin Bourrillion
     */
    public class SetContainsBenchmark {
      // Start at 4.88 then multiply by 2*2^phi <evil cackle> - The goal is be uniform
      // yet visit a variety of "values-relative-to-the-next-power-of-2"
      @Param({"5", "30", "180", "1100", "6900", "43000", "260000"}) // "1600000", "9800000"
      private int size;
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.4K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/math/StatsTesting.java

      static final double LARGE_INTEGER_VALUES_MEAN =
          BigInteger.valueOf(Integer.MAX_VALUE)
              .multiply(BigInteger.valueOf(3L))
              .divide(BigInteger.valueOf(4L))
              .doubleValue();
      static final double LARGE_INTEGER_VALUES_POPULATION_VARIANCE =
          BigInteger.valueOf(Integer.MAX_VALUE)
              .multiply(BigInteger.valueOf(Integer.MAX_VALUE))
              .divide(BigInteger.valueOf(16L))
              .doubleValue();
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Nov 09 22:49:56 GMT 2023
    - 23.8K bytes
    - Viewed (0)
  4. android/guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java

          // Math.sin is very slow for values outside 4*pi
          // Need to take absolute value to avoid inverting the value.
          for (double i = 0; i < 100; i += 20) {
            v =
                v.add(
                    v.multiply(
                        BigInteger.valueOf(((Double) Math.abs(Math.sin(i) * 10.0)).longValue())));
          }
          return v;
        }
      }
    
      public enum ComparatorType {
        CHEAP {
          @Override
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 4.3K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/math/BigIntegerMathTest.java

            try {
              BigInteger quotient = BigIntegerMath.divide(p, q, UNNECESSARY);
              BigInteger undone = quotient.multiply(q);
              if (!p.equals(undone)) {
                failFormat("expected %s.multiply(%s) = %s; got %s", quotient, q, p, undone);
              }
              assertTrue(dividesEvenly);
            } catch (ArithmeticException e) {
              assertFalse(dividesEvenly);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.2K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/math/BigIntegerMathTest.java

            try {
              BigInteger quotient = BigIntegerMath.divide(p, q, UNNECESSARY);
              BigInteger undone = quotient.multiply(q);
              if (!p.equals(undone)) {
                failFormat("expected %s.multiply(%s) = %s; got %s", quotient, q, p, undone);
              }
              assertTrue(dividesEvenly);
            } catch (ArithmeticException e) {
              assertFalse(dividesEvenly);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.2K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/primitives/UnsignedLongTest.java

          for (long b : TEST_LONGS) {
            UnsignedLong aUnsigned = UnsignedLong.fromLongBits(a);
            UnsignedLong bUnsigned = UnsignedLong.fromLongBits(b);
            long expected =
                aUnsigned.bigIntegerValue().multiply(bUnsigned.bigIntegerValue()).longValue();
            UnsignedLong unsignedMul = aUnsigned.times(bUnsigned);
            assertThat(unsignedMul.longValue()).isEqualTo(expected);
          }
        }
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 16:10:08 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/math/LongMath.java

                  // It's definitely safe to multiply into numerator and denominator.
                  numerator *= n;
                  denominator *= i;
                  numeratorBits += nBits;
                } else {
                  // It might not be safe to multiply into numerator and denominator,
                  // so multiply (numerator / denominator) into result.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 44.6K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/primitives/UnsignedLongTest.java

          for (long b : TEST_LONGS) {
            UnsignedLong aUnsigned = UnsignedLong.fromLongBits(a);
            UnsignedLong bUnsigned = UnsignedLong.fromLongBits(b);
            long expected =
                aUnsigned.bigIntegerValue().multiply(bUnsigned.bigIntegerValue()).longValue();
            UnsignedLong unsignedMul = aUnsigned.times(bUnsigned);
            assertThat(unsignedMul.longValue()).isEqualTo(expected);
          }
        }
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 06 16:10:08 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/math/IntMathTest.java

      @AndroidIncompatible // presumably slow
      public void testCheckedMultiply() {
        for (int a : ALL_INTEGER_CANDIDATES) {
          for (int b : ALL_INTEGER_CANDIDATES) {
            BigInteger expectedResult = valueOf(a).multiply(valueOf(b));
            boolean expectedSuccess = fitsInInt(expectedResult);
            try {
              assertEquals(a * b, IntMath.checkedMultiply(a, b));
              assertTrue(expectedSuccess);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 24.5K bytes
    - Viewed (0)
Back to top