Searched refs:scale (Results 1 - 25 of 29) sorted by relevance

12

/libcore/luni/src/main/java/java/math/
H A DBigDecimal.java30 * <p>A value is represented by an arbitrary-precision "unscaled value" and a signed 32-bit "scale",
31 * combined thus: {@code unscaled * 10<sup>-scale</sup>}. See {@link #unscaledValue} and {@link #scale}.
222 * The 32-bit integer scale in the internal representation of {@code BigDecimal}.
224 private int scale; field in class:BigDecimal
237 private BigDecimal(long smallValue, int scale){ argument
239 this.scale = scale;
243 private BigDecimal(int smallValue, int scale){ argument
245 this.scale
574 BigDecimal(BigInteger unscaledVal, int scale) argument
597 BigDecimal(BigInteger unscaledVal, int scale, MathContext mc) argument
669 valueOf(long unscaledVal, int scale) argument
991 divide(BigDecimal divisor, int scale, int roundingMode) argument
1018 divide(BigDecimal divisor, int scale, RoundingMode roundingMode) argument
1074 divideBigIntegers(BigInteger scaledDividend, BigInteger scaledDivisor, int scale, RoundingMode roundingMode) argument
1110 dividePrimitiveLongs(long scaledDividend, long scaledDivisor, int scale, RoundingMode roundingMode) argument
1771 public int scale() { method in class:BigDecimal
[all...]
H A DConversion.java132 * being scaled by {@code scale}.
137 static String toDecimalScaledString(BigInteger val, int scale) { argument
147 switch (scale) {
164 if (scale < 0) {
169 result1.append(-scale);
239 int exponent = resLengthInChars - currentChar - scale - 1;
240 if (scale == 0) {
247 if ((scale > 0) && (exponent >= -6)) {
297 static String toDecimalScaledString(long value, int scale) { argument
306 switch (scale) {
[all...]
/libcore/luni/src/test/java/libcore/java/math/
H A DOldBigDecimalTest.java75 assertTrue("the number 2.323E102 after setting scale is wrong",
76 setScale2.scale() == 4);
82 assertTrue("the scale of the number -1.253E-12 after setting scale is wrong",
83 setScale2.scale() == 17);
85 "the representation of the number -1.253E-12 after setting scale is wrong, " + setScale2.toString(),
92 "the number 1234.5908 after setting scale to 1/RoundingMode.CEILING is wrong",
93 setScale2.toString().equals("1234.6") && setScale2.scale() == 1);
97 "the number -1234.5908 after setting scale to 1/RoundingMode.CEILING is wrong",
99 && setScale2.scale()
[all...]
H A DOldBigDecimalScaleOperationsTest.java32 assertEquals("incorrect scale", 24, res.scale());
35 assertEquals("incorrect scale", 84, res.scale());
57 assertEquals("incorrect scale", 24, res.scale());
60 assertEquals("incorrect scale", 84, res.scale());
63 assertEquals("incorrect scale", -16, res.scale());
[all...]
H A DBigDecimalTest.java79 assertEquals(21, a.scale());
80 assertEquals(21, b.scale());
H A DOldBigDecimalCompareTest.java61 assertEquals("incorrect scale", 10, res.scale());
H A DOldBigDecimalConstructorsTest.java44 assertEquals("incorrect scale", resScale, result.scale());
112 * new BigDecimal(BigInteger value, int scale, MathContext)
125 assertEquals("incorrect scale", resScale, result.scale());
288 assertEquals("incorrect scale", resScale, result.scale());
441 assertEquals("incorrect scale", resScale, result.scale());
579 assertEquals("incorrect scale", resScal
[all...]
H A DOldBigDecimalConvertTest.java417 assertTrue("incorrect value", result.scale() == 0);
422 assertTrue("incorrect value", result.scale() == 0);
427 assertTrue("incorrect value", result.scale() == 0);
437 assertTrue("incorrect value", bdResult.scale() == iScale);
445 assertTrue("incorrect value", bdResult.scale() == iScale);
H A DOldBigDecimalArithmeticTest.java49 assertEquals("Incorrect scale!", 5, res.scale());
64 assertEquals("Incorrect scale!", 1, res.scale());
72 assertEquals("Incorrect scale!", 6, res.scale());
89 assertEquals("Incorrect scale!", -16, res.scale());
121 assertEquals("incorrect scale", cScale, result.scale());
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
H A DBigDecimalTest.java42 && big.scale() == 0);
52 && big.scale() == 5);
74 && big.scale() == 0);
87 big.scale() == 0);
97 && big.scale() == 14);
101 && big.scale() == 0);
105 && big.scale() == 0);
190 && sum.scale() == 3);
223 && divd3.scale() == divd1.scale());
[all...]
H A DBigDecimalScaleOperationsTest.java28 * Methods: movePointLeft, movePointRight, scale, setScale, unscaledValue *
32 * Check the default scale
38 assertTrue("incorrect scale", aNumber.scale() == cScale);
42 * Check a negative scale
49 assertTrue("incorrect scale", aNumber.scale() == cScale);
53 * Check a positive scale
60 assertTrue("incorrect scale", aNumber.scale()
[all...]
H A DBigDecimalConstructorsTest.java73 assertEquals("incorrect scale", 0, aNumber.scale());
84 * new BigDecimal(BigInteger value, int scale)
92 assertEquals("incorrect scale", aScale, aNumber.scale());
108 assertEquals("incorrect scale", resScale, result.scale());
112 * new BigDecimal(BigInteger value, int scale, MathContext)
125 assertEquals("incorrect scale", resScale, result.scale());
[all...]
H A DBigDecimalArithmeticTest.java46 assertEquals("incorrect scale", cScale, result.scale());
64 assertEquals("incorrect scale", cScale, result.scale());
81 assertEquals("incorrect scale", cScale, result.scale());
99 assertEquals("incorrect scale", cScale, result.scale());
116 assertEquals("incorrect scale", cScale, result.scale());
[all...]
H A DBigDecimalConvertTest.java208 assertEquals("incorrect scale", resScale, result.scale());
222 assertEquals("incorrect scale", resScale, result.scale());
369 * representation; scale == 0.
381 * scale == 0.
393 * scale == 0.
405 * scale == 0.
416 * scale == 0.
446 * Create a BigDecimal from a positive long value; scale
[all...]
H A DBigDecimalCompareTest.java69 assertEquals("incorrect scale", resScale, res.scale());
85 assertEquals("incorrect scale", resScale, res.scale());
89 * Compare to a number of an equal scale
103 * Compare to a number of an equal scale
117 * Compare to a number of an greater scale
131 * Compare to a number of an greater scale
145 * Compare to a number of an less scale
159 * Compare to a number of an less scale
[all...]
/libcore/luni/src/test/java/libcore/io/
H A DMemoryTest.java32 int scale = SizeOf.INT;
34 byte[] array = (byte[]) runtime.newNonMovableArray(byte.class, scale * values.length + 1);
53 Memory.pokeIntArray(ptr + i * scale, values, i, 1, true);
73 int scale = SizeOf.LONG;
75 byte[] array = (byte[]) runtime.newNonMovableArray(byte.class, scale * values.length + 1);
94 Memory.pokeLongArray(ptr + i * scale, values, i, 1, true);
111 int scale = SizeOf.SHORT;
113 byte[] array = (byte[]) runtime.newNonMovableArray(byte.class, scale * values.length + 1);
132 Memory.pokeShortArray(ptr + i * scale, values, i, 1, true);
/libcore/luni/src/main/java/java/util/concurrent/atomic/
H A DAtomicIntegerArray.java28 int scale = unsafe.arrayIndexScale(int[].class);
29 if ((scale & (scale - 1)) != 0)
30 throw new Error("data type scale not a power of two");
31 shift = 31 - Integer.numberOfLeadingZeros(scale);
H A DAtomicLongArray.java27 int scale = unsafe.arrayIndexScale(long[].class);
28 if ((scale & (scale - 1)) != 0)
29 throw new Error("data type scale not a power of two");
30 shift = 31 - Integer.numberOfLeadingZeros(scale);
H A DAtomicReferenceArray.java37 int scale = unsafe.arrayIndexScale(Object[].class);
38 if ((scale & (scale - 1)) != 0)
39 throw new Error("data type scale not a power of two");
40 shift = 31 - Integer.numberOfLeadingZeros(scale);
/libcore/luni/src/main/java/java/lang/
H A DRealToString.java274 long scale = MathUtils.LONG_POWERS_OF_TEN[-k];
275 R = R * scale;
276 M = M == 1 ? scale : M * scale;
/libcore/luni/src/main/java/javax/xml/datatype/
H A DDuration.java938 int scale = bd.scale();
940 if (scale == 0) {
946 int insertionPoint = intString.length() - scale;
/libcore/luni/src/main/java/java/sql/
H A DCallableStatement.java102 * after the decimal point is specified by {@code scale}.
107 * @param scale
117 public BigDecimal getBigDecimal(int parameterIndex, int scale) argument
810 * has a scale parameter, should be used for the JDBC types {@code NUMERIC}
823 * @param scale
830 public void registerOutParameter(int parameterIndex, int sqlType, int scale) argument
870 * the variant of this method that takes a {@code scale}
882 * has a scale parameter, should be used for the JDBC types {@code NUMERIC}
894 * @param scale
901 int scale) throw
900 registerOutParameter(String parameterName, int sqlType, int scale) argument
1256 setObject(String parameterName, Object theObject, int targetSqlType, int scale) argument
[all...]
H A DResultSet.java304 * @param scale
311 public BigDecimal getBigDecimal(int columnIndex, int scale) argument
333 * @param scale
340 public BigDecimal getBigDecimal(String columnName, int scale) argument
1761 * @param scale
1768 public void updateObject(int columnIndex, Object x, int scale) argument
1790 * @param scale
1797 public void updateObject(String columnName, Object x, int scale) argument
/libcore/luni/src/test/java/libcore/java/sql/
H A DOldResultSetMetaDataTest.java279 int scale = 3;
282 "valueFloat FLOAT , scaleTest NUMERIC("+precisionNum+","+scale+"),"+
346 int scale = 3;
348 "valueFloat FLOAT , scaleTest NUMERIC(10,"+scale+") );";
360 assertEquals(scale,rsmd2.getScale(3));
/libcore/luni/src/main/java/libcore/icu/
H A DNativeDecimalFormat.java376 private int makeScalePositive(int scale, StringBuilder val) { argument
377 if (scale < 0) {
378 scale = -scale;
379 for (int i = scale; i > 0; i--) {
382 scale = 0;
384 return scale;

Completed in 416 milliseconds

12