/libcore/luni/src/main/java/java/math/ |
RoundingMode.java | 32 UP(BigDecimal.ROUND_UP), 39 DOWN(BigDecimal.ROUND_DOWN), 48 CEILING(BigDecimal.ROUND_CEILING), 57 FLOOR(BigDecimal.ROUND_FLOOR), 63 HALF_UP(BigDecimal.ROUND_HALF_UP), 69 HALF_DOWN(BigDecimal.ROUND_HALF_DOWN), 75 HALF_EVEN(BigDecimal.ROUND_HALF_EVEN), 82 UNNECESSARY(BigDecimal.ROUND_UNNECESSARY); 84 /** The old constant of <code>BigDecimal</code>. */ 93 * Converts rounding mode constants from class {@code BigDecimal} int [all...] |
BigDecimal.java | 41 public class BigDecimal extends Number implements Comparable<BigDecimal>, Serializable { 172 private static final BigDecimal[] BI_SCALED_BY_ZERO = new BigDecimal[BI_SCALED_BY_ZERO_LENGTH]; 178 private static final BigDecimal[] ZERO_SCALED_BY = new BigDecimal[11]; 187 BI_SCALED_BY_ZERO[i] = new BigDecimal(i, 0); 188 ZERO_SCALED_BY[i] = new BigDecimal(0, i); 203 * The constant zero as a {@code BigDecimal}. 205 public static final BigDecimal ZERO = new BigDecimal(0, 0) [all...] |
/external/apache-harmony/math/src/test/java/org/apache/harmony/tests/java/math/ |
BigDecimalCompareTest.java | 23 import java.math.BigDecimal; 31 * Class: java.math.BigDecimal 37 * Abs() of a negative BigDecimal 41 BigDecimal aNumber = new BigDecimal(a); 47 * Abs() of a positive BigDecimal 51 BigDecimal aNumber = new BigDecimal(a); 57 * Abs(MathContext) of a negative BigDecimal 61 BigDecimal aNumber = new BigDecimal(a) [all...] |
BigDecimalArithmeticTest.java | 20 import java.math.BigDecimal; 28 * Class: java.math.BigDecimal 42 BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale); 43 BigDecimal bNumber = new BigDecimal(new BigInteger(b), bScale); 44 BigDecimal result = aNumber.add(bNumber); 59 BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale); 60 BigDecimal bNumber = new BigDecimal(new BigInteger(b), bScale) [all...] |
BigDecimalConvertTest.java | 24 import java.math.BigDecimal; 28 * Class: java.math.BigDecimal 34 * Double value of a negative BigDecimal 38 BigDecimal aNumber = new BigDecimal(a); 44 * Double value of a positive BigDecimal 48 BigDecimal aNumber = new BigDecimal(a); 54 * Double value of a large positive BigDecimal 58 BigDecimal aNumber = new BigDecimal(a) [all...] |
BigDecimalScaleOperationsTest.java | 27 * Class: java.math.BigDecimal 37 BigDecimal aNumber = new BigDecimal(new BigInteger(a)); 48 BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale); 59 BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale); 70 BigDecimal aNumber = new BigDecimal(new BigInteger(a), aScale); 81 BigDecimal aNumber = new BigDecimal(bNumber, aScale) [all...] |
BigDecimalConstructorsTest.java | 23 import java.math.BigDecimal; 31 * Class: java.math.BigDecimal 41 assertEquals("incorrect string value", oneS, BigDecimal.ONE.toString()); 42 assertEquals("incorrect double value", oneD, BigDecimal.ONE.doubleValue(), 0); 51 assertEquals("incorrect string value", oneS, BigDecimal.TEN.toString()); 52 assertEquals("incorrect double value", oneD, BigDecimal.TEN.doubleValue(), 0); 61 assertEquals("incorrect string value", oneS, BigDecimal.ZERO.toString()); 62 assertEquals("incorrect double value", oneD, BigDecimal.ZERO.doubleValue(), 0); 66 * new BigDecimal(BigInteger value) 71 BigDecimal aNumber = new BigDecimal(bA) [all...] |
/external/apache-harmony/math/src/test/java/tests/api/java/math/ |
BigDecimalTest.java | 24 import java.math.BigDecimal; 36 * @tests java.math.BigDecimal#BigDecimal(java.math.BigInteger) 39 BigDecimal big = new BigDecimal(value); 40 assertTrue("the BigDecimal value is not initialized properly", big 46 * @tests java.math.BigDecimal#BigDecimal(java.math.BigInteger, int) 49 BigDecimal big = new BigDecimal(value2, 5) [all...] |
/libcore/luni/src/test/java/tests/api/java/math/ |
RoundingModeTest.java | 20 import java.math.BigDecimal; 29 assertEquals("valueOf failed for ROUND_CEILING", RoundingMode.valueOf(BigDecimal.ROUND_CEILING), RoundingMode.CEILING); 30 assertEquals("valueOf failed for ROUND_DOWN", RoundingMode.valueOf(BigDecimal.ROUND_DOWN), RoundingMode.DOWN); 31 assertEquals("valueOf failed for ROUND_FLOOR", RoundingMode.valueOf(BigDecimal.ROUND_FLOOR), RoundingMode.FLOOR); 32 assertEquals("valueOf failed for ROUND_HALF_DOWN", RoundingMode.valueOf(BigDecimal.ROUND_HALF_DOWN), RoundingMode.HALF_DOWN); 33 assertEquals("valueOf failed for ROUND_HALF_EVEN", RoundingMode.valueOf(BigDecimal.ROUND_HALF_EVEN), RoundingMode.HALF_EVEN); 34 assertEquals("valueOf failed for ROUND_HALF_UP", RoundingMode.valueOf(BigDecimal.ROUND_HALF_UP), RoundingMode.HALF_UP); 35 assertEquals("valueOf failed for ROUND_UNNECESSARY", RoundingMode.valueOf(BigDecimal.ROUND_UNNECESSARY), RoundingMode.UNNECESSARY); 36 assertEquals("valueOf failed for ROUND_UP", RoundingMode.valueOf(BigDecimal.ROUND_UP), RoundingMode.UP);
|
MathContextTest.java | 20 import java.math.BigDecimal; 31 BigDecimal aNumber = new BigDecimal(a); 73 BigDecimal res = aNumber.abs(mcInt6); 75 new BigDecimal("1.23809E+68"),
|
/libcore/luni/src/test/java/libcore/java/text/ |
DecimalFormatTest.java | 19 import java.math.BigDecimal; 59 // Regression test for http://b/1897917: BigDecimal does not take into account multiplier. 61 // For example. the BigDecimal 0.17 formatted in PercentInstance is 0% instead of 17%: 63 assertEquals("17%", pf.format(BigDecimal.valueOf(0.17))); 67 BigDecimal bd = new BigDecimal(longDec); 103 assertEquals(df.format(BigDecimal.valueOf(0.16)), 104 df.format(BigDecimal.valueOf(0.16).doubleValue())); 105 assertEquals(df.format(BigDecimal.valueOf(0.0293)), 106 df.format(BigDecimal.valueOf(0.0293).doubleValue())) [all...] |
/libcore/luni/src/test/java/libcore/java/math/ |
OldBigDecimalConvertTest.java | 24 import java.math.BigDecimal; 33 BigDecimal aNumber = new BigDecimal(a); 44 BigDecimal aNumber = new BigDecimal(a); 54 BigDecimal aNumber = new BigDecimal("-2147483647.999"); 65 BigDecimal aNumber = new BigDecimal(a); 76 BigDecimal aNumber = new BigDecimal(a) [all...] |
OldBigDecimalConstructorsTest.java | 23 import java.math.BigDecimal; 32 * new BigDecimal(BigInteger value, MathContext) 42 BigDecimal result = new BigDecimal(bA, mc); 48 BigDecimal bd; 53 bd = new BigDecimal(bi, mc); 55 bd = new BigDecimal(nbi, mc); 59 bd = new BigDecimal(bi, mc); 61 bd = new BigDecimal(nbi, mc); 65 bd = new BigDecimal(bi, mc) [all...] |
OldBigDecimalScaleOperationsTest.java | 24 import java.math.BigDecimal; 30 BigDecimal a = new BigDecimal("12345.6789012345678901234567890123456789"); 31 BigDecimal res = a.movePointRight(10); 46 BigDecimal a = new BigDecimal("123456789012345678901234567890123456789E25"); 55 BigDecimal a = new BigDecimal("12345.6789012345678901234567890123456789"); 56 BigDecimal res = a.movePointRight(10); 70 a = new BigDecimal("123456789012345678901234567890123456789E25") [all...] |
OldBigDecimalArithmeticTest.java | 20 import java.math.BigDecimal; 30 BigDecimal a, b, res; 33 a = new BigDecimal("123456789012345.678"); 34 b = new BigDecimal("100000000000000.009"); 45 a = new BigDecimal("1234567890123456789012345678.9012395"); 46 b = new BigDecimal("1000000000000000090000000000.0000005"); 55 BigDecimal a, b, res; 58 a = new BigDecimal("12345678901234567.8"); 59 b = new BigDecimal("10000000000000000.9"); 68 a = new BigDecimal("1234567890123456789012345678.9012395") [all...] |
BigDecimalTest.java | 19 import java.math.BigDecimal; 53 BigDecimal parsed = new BigDecimal(value); 57 BigDecimal computed = parsed.divide(BigDecimal.ONE); 63 BigDecimal bigDecimal = new BigDecimal("0.999999999999999"); 64 BigDecimal rounded = bigDecimal.round(new MathContext(2, RoundingMode.FLOOR)) [all...] |
OldBigDecimalTest.java | 20 import java.math.BigDecimal; 28 * java.math.BigDecimal#BigDecimal(double) 34 BigDecimal big = new BigDecimal(123E04); 36 "the BigDecimal value taking a double argument is not initialized properly", 38 big = new BigDecimal(123.375); 41 big = new BigDecimal(Math.pow(2, -33)); 44 big = new BigDecimal(123456 * Math.pow(2, -33)); 47 big = new BigDecimal(-123456 * Math.pow(2, -33)) [all...] |
OldBigDecimalCompareTest.java | 24 import java.math.BigDecimal; 34 BigDecimal aNumber = new BigDecimal(a); 58 BigDecimal aNumber = new BigDecimal(new BigInteger(a), 41); 59 BigDecimal res = aNumber.negate(mc);
|
/libcore/luni/src/test/java/libcore/java/util/ |
FormatterTest.java | 19 import java.math.BigDecimal; 103 // BigDecimal or Formatter.) 105 BigDecimal[] input = new BigDecimal[] { 106 new BigDecimal("20.00000"), 107 new BigDecimal("20.000000"), 108 new BigDecimal(".2"), 109 new BigDecimal("2"), 110 new BigDecimal("-2"), 111 new BigDecimal("200000000000000000000000") [all...] |
/libcore/luni/src/main/java/javax/xml/datatype/ |
XMLGregorianCalendar.java | 22 import java.math.BigDecimal; 202 * BigDecimal fractionalSecond, 228 * BigDecimal fractionalSecond, 321 * @see #setTime(int, int, int, BigDecimal) 397 public abstract void setFractionalSecond(BigDecimal fractional); 420 BigDecimal fractional) { 591 BigDecimal fractionalSeconds = getFractionalSecond(); 616 * @see #setTime(int, int, int, BigDecimal) 618 public abstract BigDecimal getFractionalSecond(); [all...] |
DatatypeFactory.java | 22 import java.math.BigDecimal; 235 final BigDecimal seconds); 263 * BigDecimal seconds) 290 BigDecimal realSeconds = (seconds != DatatypeConstants.FIELD_UNDEFINED) ? BigDecimal.valueOf((long) seconds) : null; 419 BigInteger.valueOf(minutes), BigDecimal.valueOf(milliseconds, 3)); 423 BigDecimal seconds = BigDecimal.valueOf(milliseconds, 3); 477 (second != null)? new BigDecimal(second):null [all...] |
/cts/tests/tests/text/src/android/text/format/cts/ |
FormatterTest.java | 19 import java.math.BigDecimal; 41 BigDecimal bd = new BigDecimal((long) 1024, mc);
|
/external/apache-harmony/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/ |
FormatterTest.java | 30 import java.math.BigDecimal; [all...] |
/libcore/luni/src/main/java/java/sql/ |
SQLInput.java | 22 import java.math.BigDecimal; 131 * java.math.BigDecimal}. 133 * @return the attribute as a {@code java.math.BigDecimal}. {@code null} if 137 * @see java.math.BigDecimal 139 public BigDecimal readBigDecimal() throws SQLException;
|
SQLOutput.java | 22 import java.math.BigDecimal; 124 * Write a {@code java.math.BigDecimal} value into the output stream. 127 * the {@code BigDecimal} value to write. 131 public void writeBigDecimal(BigDecimal theBigDecimal) throws SQLException;
|