Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 139 for square (0.16 sec)

  1. android/guava-tests/test/com/google/common/math/MathTesting.java

        // Add boundary values manually to avoid over/under flow (this covers 2^N for 0 and 31).
        intValues.add(Integer.MAX_VALUE - 1, Integer.MAX_VALUE);
        // Add values up to 40. This covers cases like "square of a prime" and such.
        for (int i = 1; i <= 40; i++) {
          intValues.add(i);
        }
        // Now add values near 2^N for lots of values of N.
        for (int exponent : asList(2, 3, 4, 9, 15, 16, 17, 24, 25, 30)) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 11.2K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/base/Strings.java

          builder.append(args[i++]);
          templateStart = placeholderStart + 2;
        }
        builder.append(template, templateStart, template.length());
    
        // if we run out of placeholders, append the extra args in square braces
        if (i < args.length) {
          builder.append(" [");
          builder.append(args[i++]);
          while (i < args.length) {
            builder.append(", ");
            builder.append(args[i++]);
          }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Apr 09 00:49:18 GMT 2021
    - 12.3K bytes
    - Viewed (0)
  3. guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/testers/Platform.java

          builder.append(args[i++]);
          templateStart = placeholderStart + 2;
        }
        builder.append(template.substring(templateStart));
    
        // if we run out of placeholders, append the extra args in square braces
        if (i < args.length) {
          builder.append(" [");
          builder.append(args[i++]);
          while (i < args.length) {
            builder.append(", ");
            builder.append(args[i++]);
          }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Oct 04 15:31:40 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/math/IntMath.java

              return accum;
            case 1:
              return b * accum;
            default:
              accum *= ((k & 1) == 0) ? 1 : b;
              b *= b;
          }
        }
      }
    
      /**
       * Returns the square root of {@code x}, rounded with the specified rounding mode.
       *
       * @throws IllegalArgumentException if {@code x < 0}
       * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code
    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)
  5. android/guava/src/com/google/common/math/BigIntegerMath.java

            return (logX2Floor < 2 * logFloor + 1) ? logFloor : logFloor + 1;
    
          default:
            throw new AssertionError();
        }
      }
    
      /*
       * The maximum number of bits in a square root for which we'll precompute an explicit half power
       * of two. This can be any value, but higher values incur more class load time and linearly
       * increasing memory consumption.
       */
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 18.9K bytes
    - Viewed (0)
  6. guava-tests/benchmark/com/google/common/cache/LoadingCacheSingleThreadBenchmark.java

        }
        requests.addAndGet(reps);
        return dummy;
      }
    
      private int nextRandomKey() {
        int a = random.nextInt(max);
    
        /*
         * For example, if concentration=2.0, the following takes the square root of
         * the uniformly-distributed random integer, then truncates any fractional
         * part, so higher integers would appear (in this case linearly) more often
         * than lower ones.
         */
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.4K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/math/LongMath.java

              return accum;
            case 1:
              return accum * b;
            default:
              accum *= ((k & 1) == 0) ? 1 : b;
              b *= b;
          }
        }
      }
    
      /**
       * Returns the square root of {@code x}, rounded with the specified rounding mode.
       *
       * @throws IllegalArgumentException if {@code x < 0}
       * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code
    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)
  8. guava-tests/test/com/google/common/math/IntMathTest.java

      public void testSqrtExactMatchesFloorOrThrows() {
        for (int x : POSITIVE_INTEGER_CANDIDATES) {
          int floor = IntMath.sqrt(x, FLOOR);
          // We only expect an exception if x was not a perfect square.
          boolean isPerfectSquare = (floor * floor == x);
          try {
            assertEquals(floor, IntMath.sqrt(x, UNNECESSARY));
            assertTrue(isPerfectSquare);
          } catch (ArithmeticException e) {
    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. android/guava-tests/test/com/google/common/collect/MultimapsTest.java

        Function<Integer, Integer> square =
            new Function<Integer, Integer>() {
              @Override
              public Integer apply(Integer in) {
                return in * in;
              }
            };
        Multimap<String, Integer> transformed = Multimaps.transformValues(multimap, square);
        assertThat(transformed.entries())
            .containsExactly(
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 39.1K bytes
    - Viewed (0)
  10. guava/src/com/google/common/base/Preconditions.java

     *     throw new IllegalArgumentException("input is negative: " + value);
     *   }
     *   // calculate square root
     * }
     * }</pre>
     *
     * <p>to be replaced with the more compact
     *
     * <pre>{@code
     * public static double sqrt(double value) {
     *   checkArgument(value >= 0, "input is negative: %s", value);
     *   // calculate square root
     * }
     * }</pre>
     *
     * <p>so that a hypothetical bad caller of this method, such as:
     *
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Wed Feb 14 15:46:55 GMT 2024
    - 52.9K bytes
    - Viewed (0)
Back to top