- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for testSqrtOfPerfectSquareAsDoubleIsPerfect (0.19 sec)
-
guava-tests/test/com/google/common/math/LongMathTest.java
} } @J2ktIncompatible // slow enough to cause flakiness @GwtIncompatible // far too slow public void testSqrtOfPerfectSquareAsDoubleIsPerfect() { // This takes just over a minute on my machine. for (long n = 0; n <= LongMath.FLOOR_SQRT_MAX_LONG; n++) { long actual = (long) Math.sqrt(n * n); assertTrue(actual == n); }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 15:00:32 UTC 2024 - 30.6K bytes - Viewed (0) -
guava/src/com/google/common/math/LongMath.java
* since casting to long is monotonic * k <= (long) Math.sqrt(x) <= k + 1 * since (long) Math.sqrt(k * k) == k, as checked exhaustively in * {@link LongMathTest#testSqrtOfPerfectSquareAsDoubleIsPerfect} */ long guess = (long) Math.sqrt((double) x); // Note: guess is always <= FLOOR_SQRT_MAX_LONG. long guessSquared = guess * guess;
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/math/LongMath.java
* since casting to long is monotonic * k <= (long) Math.sqrt(x) <= k + 1 * since (long) Math.sqrt(k * k) == k, as checked exhaustively in * {@link LongMathTest#testSqrtOfPerfectSquareAsDoubleIsPerfect} */ long guess = (long) Math.sqrt((double) x); // Note: guess is always <= FLOOR_SQRT_MAX_LONG. long guessSquared = guess * guess;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 09 16:39:37 UTC 2024 - 45.2K bytes - Viewed (0)