Home
last modified time | relevance | path

Searched refs:big (Results 1 – 13 of 13) sorted by relevance

/libcore/luni/src/test/java/libcore/java/math/
DOldBigDecimalTest.java34 BigDecimal big = new BigDecimal(123E04); in test_ConstructorD() local
37 big.toString().equals("1230000")); in test_ConstructorD()
38 big = new BigDecimal(123.375); in test_ConstructorD()
39 assertTrue("init(D) failed for 123.375; became " + big, in test_ConstructorD()
40 big.toString().equals("123.375") ); in test_ConstructorD()
41 big = new BigDecimal(Math.pow(2, -33)); in test_ConstructorD()
42 assertTrue("init(D) failed for 2^(-33) = 1.16415321826934814453125E-10; became " + big, in test_ConstructorD()
43 big.toString().equals("1.16415321826934814453125E-10") ); in test_ConstructorD()
44 big = new BigDecimal(123456 * Math.pow(2, -33)); in test_ConstructorD()
45 … assertTrue("init(D) failed for 123456 * 2^(-33) = 0.000014372169971466064453125; became " + big, in test_ConstructorD()
[all …]
DOldBigDecimalConstructorsTest.java720 BigDecimal big = new BigDecimal(value); in test_Constructor_java_math_BigInteger_int() local
722 big.unscaledValue().equals(value) in test_Constructor_java_math_BigInteger_int()
723 && big.scale() == 0); in test_Constructor_java_math_BigInteger_int()
738 BigDecimal big = new BigDecimal(123E04); in test_Constructor_Double() local
739 assertTrue("the BigDecimal value taking a double argument is not initialized properly", big in test_Constructor_Double()
741 big = new BigDecimal(1.2345E-12); in test_Constructor_Double()
743 big.doubleValue() == 1.2345E-12); in test_Constructor_Double()
744 big = new BigDecimal(-12345E-3); in test_Constructor_Double()
746 big.doubleValue() == -12.345); in test_Constructor_Double()
747 big = new BigDecimal(5.1234567897654321e138); in test_Constructor_Double()
[all …]
DBigIntegerTest.java297 BigInteger big = BigInteger.valueOf(i).shiftLeft(61); in test_longValueExact() local
299 assertEquals(i << 61, big.longValueExact()); in test_longValueExact()
301 big.compareTo(min) >= 0 && big.compareTo(max) <= 0); in test_longValueExact()
304 big.compareTo(min) < 0 || big.compareTo(max) > 0); in test_longValueExact()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
DBigDecimalTest.java39 BigDecimal big = new BigDecimal(value); in test_ConstructorLjava_math_BigInteger() local
40 assertTrue("the BigDecimal value is not initialized properly", big in test_ConstructorLjava_math_BigInteger()
42 && big.scale() == 0); in test_ConstructorLjava_math_BigInteger()
49 BigDecimal big = new BigDecimal(value2, 5); in test_ConstructorLjava_math_BigIntegerI() local
50 assertTrue("the BigDecimal value is not initialized properly", big in test_ConstructorLjava_math_BigIntegerI()
52 && big.scale() == 5); in test_ConstructorLjava_math_BigIntegerI()
53 assertTrue("the BigDecimal value is not represented properly", big in test_ConstructorLjava_math_BigIntegerI()
61 BigDecimal big = new BigDecimal(123E04); in test_ConstructorD() local
64 big.toString().equals("1230000")); in test_ConstructorD()
65 big = new BigDecimal(1.2345E-12); in test_ConstructorD()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DBitSetTest.java207 private static BitSet big() { in big() method in BitSetTest
220 BitSet result = big(); in test_differentSizes()
224 result.and(big()); in test_differentSizes()
227 result = big(); in test_differentSizes()
231 result.andNot(big()); in test_differentSizes()
234 assertFalse(big().intersects(small())); in test_differentSizes()
235 assertFalse(small().intersects(big())); in test_differentSizes()
237 result = big(); in test_differentSizes()
241 result.or(big()); in test_differentSizes()
244 result = big(); in test_differentSizes()
[all …]
/libcore/ojluni/src/main/java/sun/security/util/
DObjectIdentifier.java288 BigInteger big = BigInteger.valueOf(components[1]); in init() local
289 big = big.add(BigInteger.valueOf(components[0]*40)); in init()
290 pos += pack7Oid(big, tmp, pos); in init()
372 BigInteger big = new BigInteger(pack(encoding, fromPos, i-fromPos+1, 7, 8)); in toIntArray() local
375 BigInteger second = big.subtract(BigInteger.valueOf(80)); in toIntArray()
382 if (big.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) == 1) { in toIntArray()
385 result[which++] = big.intValue(); in toIntArray()
437 BigInteger big = new BigInteger(pack(encoding, fromPos, i-fromPos+1, 7, 8)); in toString() local
442 sb.append(big.subtract(BigInteger.valueOf(80))); in toString()
444 sb.append(big); in toString()
/libcore/ojluni/src/main/java/sun/misc/
DFDBigInteger.java1027 FDBigInteger big; in addAndCmp() local
1034 big = x; in addAndCmp()
1039 big = y; in addAndCmp()
1049 return this.cmp(big); in addAndCmp()
1057 long top = (big.data[big.nWords - 1] & LONG_MASK); in addAndCmp()
1090 return this.cmp(big.add(small)); in addAndCmp()
1182 FDBigInteger big, small; in add() local
1187 big = this; in add()
1192 big = other; in add()
1201 carry += (i < big.offset ? 0L : (big.data[i - big.offset] & LONG_MASK) ) in add()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DNumberFormatTest.java63 java.math.BigInteger big; in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition() local
65 big = new java.math.BigInteger(String.valueOf(Long.MAX_VALUE)) in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
67 out = format.format(big, new StringBuffer(), pos); in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
72 big = new java.math.BigInteger(String.valueOf(Long.MIN_VALUE)) in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
74 out = format.format(big, new StringBuffer(), pos); in test_formatLjava_lang_ObjectLjava_lang_StringBufferLjava_text_FieldPosition()
DDecimalFormatTest.java584 java.math.BigInteger big; in test_formatObject() local
586 big = new java.math.BigInteger(String.valueOf(Long.MAX_VALUE)) in test_formatObject()
588 out = format.format(big, new StringBuffer(), pos); in test_formatObject()
593 big = new java.math.BigInteger(String.valueOf(Long.MIN_VALUE)) in test_formatObject()
595 out = format.format(big, new StringBuffer(), pos); in test_formatObject()
/libcore/benchmarks/src/benchmarks/
DBigIntegerBenchmark.java54 BigInteger big = BigInteger.TEN.pow(prec).shiftLeft(30).add(BigInteger.ONE); in inner() local
57 sum = sum.add(big.multiply(big)); in inner()
/libcore/ojluni/src/main/java/java/math/
DBigInteger.java1404 private static int[] subtract(int[] big, long val) { in subtract() argument
1406 int bigIndex = big.length; in subtract()
1411 difference = (big[--bigIndex] & LONG_MASK) - val; in subtract()
1414 difference = (big[--bigIndex] & LONG_MASK) - (val & LONG_MASK); in subtract()
1416 … difference = (big[--bigIndex] & LONG_MASK) - (highWord & LONG_MASK) + (difference >> 32); in subtract()
1423 borrow = ((result[--bigIndex] = big[bigIndex] - 1) == -1); in subtract()
1427 result[--bigIndex] = big[bigIndex]; in subtract()
1461 private static int[] subtract(int[] big, int[] little) { in subtract() argument
1462 int bigIndex = big.length; in subtract()
1469 difference = (big[--bigIndex] & LONG_MASK) - in subtract()
[all …]
DBigDecimal.java1388 BigDecimal big; in preAlign() local
1392 big = lhs; in preAlign()
1395 big = augend; in preAlign()
1405 long estResultUlpScale = (long) big.scale - big.precision() + mc.precision; in preAlign()
1417 if (smallHighDigitPos > big.scale + 2 && // big and small disjoint in preAlign()
1419 …small = BigDecimal.valueOf(small.signum(), this.checkScale(Math.max(big.scale, estResultUlpScale) … in preAlign()
1424 BigDecimal[] result = {big, small}; in preAlign()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DFormatterTest.java2676 BigInteger big = new BigInteger("100"); in test_formatLjava_lang_String$Ljava_lang_Object_BigIntegerExceptionOrder() local
2701 f.format("%+ .4o", big); in test_formatLjava_lang_String$Ljava_lang_Object_BigIntegerExceptionOrder()
2708 f.format("%+ -o", big); in test_formatLjava_lang_String$Ljava_lang_Object_BigIntegerExceptionOrder()
2715 f.format("%-O", big); in test_formatLjava_lang_String$Ljava_lang_Object_BigIntegerExceptionOrder()