Lines Matching refs:scale

10  * point is called the <code>scale</code> of the <code>SimpleBigDecimal</code>.
11 * Unlike in {@link java.math.BigDecimal BigDecimal}, the scale is not adjusted
13 * taking part in the same arithmetic operation must have equal scale. The
15 * <code>SimpleBigDecimal</code> with double scale.
23 private final int scale;
30 * @param scale The scale of the <code>SimpleBigDecimal</code> to be
34 public static SimpleBigDecimal getInstance(BigInteger value, int scale)
36 return new SimpleBigDecimal(value.shiftLeft(scale), scale);
42 * 2<sup>scale</sup></code>.
44 * @param scale The scale of the constructed <code>SimpleBigDecimal</code>.
46 public SimpleBigDecimal(BigInteger bigInt, int scale)
48 if (scale < 0)
50 throw new IllegalArgumentException("scale may not be negative");
54 this.scale = scale;
60 scale = limBigDec.scale;
65 if (scale != b.scale)
68 "same scale allowed in arithmetic operations");
76 throw new IllegalArgumentException("scale may not be negative");
79 if (newScale == scale)
84 return new SimpleBigDecimal(bigInt.shiftLeft(newScale - scale),
91 return new SimpleBigDecimal(bigInt.add(b.bigInt), scale);
96 return new SimpleBigDecimal(bigInt.add(b.shiftLeft(scale)), scale);
101 return new SimpleBigDecimal(bigInt.negate(), scale);
111 return new SimpleBigDecimal(bigInt.subtract(b.shiftLeft(scale)),
112 scale);
118 return new SimpleBigDecimal(bigInt.multiply(b.bigInt), scale + scale);
123 return new SimpleBigDecimal(bigInt.multiply(b), scale);
129 BigInteger dividend = bigInt.shiftLeft(scale);
130 return new SimpleBigDecimal(dividend.divide(b.bigInt), scale);
135 return new SimpleBigDecimal(bigInt.divide(b), scale);
140 return new SimpleBigDecimal(bigInt.shiftLeft(n), scale);
151 return bigInt.compareTo(val.shiftLeft(scale));
156 return bigInt.shiftRight(scale);
162 return add(oneHalf.adjustScale(scale)).floor();
187 return scale;
192 if (scale == 0)
199 BigInteger fract = bigInt.subtract(floorBigInt.shiftLeft(scale));
202 fract = ECConstants.ONE.shiftLeft(scale).subtract(fract);
211 char[] fractCharArr = new char[scale];
214 int zeroes = scale - fractLen;
245 return ((bigInt.equals(other.bigInt)) && (scale == other.scale));
250 return bigInt.hashCode() ^ scale;