/libcore/luni/src/test/java/libcore/java/math/ |
D | BigIntegerTest.java | 93 assertTrue(b.toString() + " " + b.bitLength(), b.bitLength() <= 128); in test_Constructor_ILjava_util_Random() 96 assertTrue(b.toString() + " " + b.bitLength(), b.bitLength() <= 16); in test_Constructor_ILjava_util_Random() 99 assertTrue(b.toString() + " " + b.bitLength(), b.bitLength() <= 5); in test_Constructor_ILjava_util_Random() 108 assertEquals(b.toString(), 128, b.bitLength()); in test_Constructor_IILjava_util_Random() 112 assertEquals(b.toString(), 16, b.bitLength()); in test_Constructor_IILjava_util_Random() 116 assertEquals(b.toString(), 5, b.bitLength()); in test_Constructor_IILjava_util_Random() 126 assertEquals(b.toString(), 2, b.bitLength()); in test_Constructor_IILjava_util_Random() 147 assertEquals(b.toString(), 128, b.bitLength()); in test_probablePrime() 151 assertEquals(b.toString(), 16, b.bitLength()); in test_probablePrime() 155 assertEquals(b.toString(), 5, b.bitLength()); in test_probablePrime()
|
/libcore/luni/src/main/java/java/math/ |
D | BigDecimal.java | 185 LONG_FIVE_POW_BIT_LENGTH[i] = bitLength(LONG_FIVE_POW[i]); 188 LONG_POWERS_OF_TEN_BIT_LENGTH[i] = bitLength(MathUtils.LONG_POWERS_OF_TEN[i]); 217 private transient int bitLength; field in BigDecimal 240 this.bitLength = bitLength(smallValue); in BigDecimal() 246 this.bitLength = bitLength(smallValue); in BigDecimal() 345 bitLength = bitLength(smallValue); in BigDecimal() 489 int mantissaBits = bitLength(mantissa); in BigDecimal() 491 bitLength = mantissaBits == 0 ? 0 : mantissaBits - scale; in BigDecimal() 492 if(bitLength < 64) { in BigDecimal() 506 bitLength = bitLength(smallValue); in BigDecimal() [all …]
|
D | BigInteger.java | 165 public BigInteger(int bitLength, int certainty, @NonNull Random random) { in BigInteger() argument 166 if (bitLength < 2) { in BigInteger() 167 throw new ArithmeticException("bitLength < 2: " + bitLength); in BigInteger() 169 if (bitLength < 16) { in BigInteger() 173 candidate = random.nextInt() & ((1 << bitLength) - 1); in BigInteger() 174 candidate |= (1 << (bitLength - 1)); // Set top bit. in BigInteger() 175 if (bitLength > 2) { in BigInteger() 185 setBigInt(BigInt.generatePrimeDefault(bitLength)); in BigInteger() 186 } while (bitLength() != bitLength); in BigInteger() 520 public int bitLength() { in bitLength() method in BigInteger [all …]
|
D | BigInt.java | 217 int actualByteCount = (NativeBN.bitLength(this.bignum) + 7) / 8; in twosCompFitsIntoBytes() 221 int bitLength() { in bitLength() method in BigInt 222 return NativeBN.bitLength(this.bignum); in bitLength() 337 static BigInt generatePrimeDefault(int bitLength) { in generatePrimeDefault() argument 339 NativeBN.BN_generate_prime_ex(r.bignum, bitLength, false, 0, 0); in generatePrimeDefault()
|
D | NativeBN.java | 74 public static native int bitLength(long a); in bitLength() method in NativeBN
|
D | Primality.java | 94 if (ni.bitLength() <= 10) { in nextProbablePrime()
|
D | Conversion.java | 76 int resLengthInChars = (int) (val.abs().bitLength() / bitsForRadixDigit + ((sign < 0) ? 1 in bigInteger2String() 430 int bitLen = val.abs().bitLength(); in bigInteger2Double()
|
D | BitLevel.java | 41 static int bitLength(BigInteger val) { in bitLength() method in BitLevel
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/ |
D | OldBigIntegerTest.java | 86 assertEquals(i, bi.bitLength()); in test_ConstructorIILjava_util_Random() 176 for (int bitLength = 100; bitLength <= 600; bitLength += 100) { in test_isProbablePrimeI() 177 BigInteger a = BigInteger.probablePrime(bitLength, rand); in test_isProbablePrimeI() 178 BigInteger b = BigInteger.probablePrime(bitLength, rand); in test_isProbablePrimeI() 182 " (bitLength = " + bitLength + ")", in test_isProbablePrimeI() 222 for (int bitLength = 50; bitLength <= 1050; bitLength += 100) { in test_probablePrime() 223 BigInteger a = BigInteger.probablePrime(bitLength, rand); in test_probablePrime()
|
D | BigIntegerConstructorsTest.java | 745 assertTrue("incorrect bitLength", aNumber.bitLength() <= bitLen); in testConstructorRandom() 757 assertEquals(b.toString(), bits, b.bitLength()); in testConstructorPrime() 762 assertEquals(b.toString(), bits, b.bitLength()); in testConstructorPrime() 767 assertEquals(b.toString(), bits, b.bitLength()); in testConstructorPrime() 773 assertEquals(b.toString(), bits, b.bitLength()); in testConstructorPrime() 778 assertTrue(b.toString(), b.bitLength() <= bits); in testConstructorPrime() 783 assertTrue(b.toString(), b.bitLength() <= bits); in testConstructorPrime()
|
D | BigIntegerTest.java | 761 int len = Math.max(i1.bitLength(), i2.bitLength()) + 66; in test_andLjava_math_BigInteger() 777 int len = Math.max(i1.bitLength(), i2.bitLength()) + 66; in test_orLjava_math_BigInteger() 793 int len = Math.max(i1.bitLength(), i2.bitLength()) + 66; in test_xorLjava_math_BigInteger() 808 int len = i1.bitLength() + 66; in test_not() 822 int len = Math.max(i1.bitLength(), i2.bitLength()) + 66; in test_andNotLjava_math_BigInteger()
|
D | BigIntegerHashCodeTest.java | 44 aNumber1.divide(aNumber2).bitLength(); in testSameObject()
|
D | BigIntegerOperateBitsTest.java | 61 assertEquals(0, aNumber.bitLength()); in testBitLengthZero() 71 assertEquals(108, aNumber.bitLength()); in testBitLengthPositive1() 81 assertEquals(96, aNumber.bitLength()); in testBitLengthPositive2() 91 assertEquals(81, aNumber.bitLength()); in testBitLengthPositive3() 101 assertEquals(108, aNumber.bitLength()); in testBitLengthNegative1() 111 assertEquals(96, aNumber.bitLength()); in testBitLengthNegative2() 121 assertEquals(80, aNumber.bitLength()); in testBitLengthNegative3()
|
/libcore/ojluni/src/main/java/sun/security/util/ |
D | KeyUtil.java | 77 size = pubk.getModulus().bitLength(); in getKeySize() 89 size = params.getOrder().bitLength(); in getKeySize() 95 size = (params != null) ? params.getP().bitLength() : -1; in getKeySize() 98 size = pubk.getParams().getP().bitLength(); in getKeySize()
|
/libcore/ojluni/src/main/java/java/security/spec/ |
D | ECFieldFp.java | 65 return p.bitLength(); in getFieldSize()
|
D | EllipticCurve.java | 63 if (c.bitLength() > m) { in checkValidity()
|
/libcore/support/src/test/java/libcore/javax/net/ssl/ |
D | RandomPrivateKeyX509ExtendedKeyManager.java | 58 int keyLengthBits = originalKeySpec.getModulus().bitLength(); in getPrivateKey()
|
/libcore/ojluni/src/main/java/java/text/ |
D | NumberFormat.java | 241 ((BigInteger)number).bitLength() < 64)) { in format()
|
D | DecimalFormat.java | 631 ((BigInteger)number).bitLength () < 64)) { in format()
|
/libcore/ojluni/src/main/java/java/time/ |
D | Duration.java | 999 if (divRem[0].bitLength() > 63) { in create()
|
/libcore/luni/src/main/native/ |
D | java_math_NativeBN.cpp | 557 NATIVE_METHOD(NativeBN, bitLength, "(J)I"),
|
/libcore/ojluni/src/main/java/java/time/format/ |
D | DateTimeFormatterBuilder.java | 2708 if (totalBig.bitLength() > 63) { in parse()
|