Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for testLog2HalfUp (0.05 sec)

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

            assertTrue(isPowerOf2);
          } catch (ArithmeticException e) {
            assertFalse(isPowerOf2);
          }
        }
      }
    
      public void testLog2HalfUp() {
        for (BigInteger x : POSITIVE_BIGINTEGER_CANDIDATES) {
          int result = BigIntegerMath.log2(x, HALF_UP);
          BigInteger x2 = x.pow(2);
          // x^2 < 2^(2 * result + 1), or else we would have rounded up
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 27K bytes
    - Viewed (0)
Back to top