SimpleBigDecimal is basically a
BigInteger with a few digits on the right of
the decimal point. The number of (binary) digits on the right of the decimal
point is called the scale of the SimpleBigDecimal.
Unlike in BigDecimal, the scale is not adjusted
automatically, but must be set manually. All SimpleBigDecimals
taking part in the same arithmetic operation must have equal scale. The
result of a multiplication of two SimpleBigDecimals returns a
SimpleBigDecimal with double scale.
| Modifier and Type | Field and Description |
|---|---|
| private final BigInteger | |
| private final int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | SimpleBigDecimal(BigInteger
The bigInt, int bigInt value parameter.The scale of the constructed scale)SimpleBigDecimal.Constructor for |
| Modifier and Type | Method and Description |
|---|---|
| public SimpleBigDecimal | |
| public SimpleBigDecimal | |
| public SimpleBigDecimal | |
| private void | |
| public int | |
| public int | |
| public SimpleBigDecimal | |
| public SimpleBigDecimal | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| public BigInteger | |
| public static SimpleBigDecimal | Returns: The such createdSimpleBigDecimal.The value of the value, int SimpleBigDecimal to be
created.The scale of the scale)SimpleBigDecimal to be
created.Returns a |
| public int | |
| public int | |
| public int | |
| public long | |
| public SimpleBigDecimal | |
| public SimpleBigDecimal | |
| public SimpleBigDecimal | |
| public BigInteger | |
| public SimpleBigDecimal | |
| public SimpleBigDecimal | |
| public SimpleBigDecimal | |
| public String |
| bigInt | back to summary |
|---|---|
| private final BigInteger bigInt | |
| scale | back to summary |
|---|---|
| private final int scale | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| SimpleBigDecimal | back to summary |
|---|---|
| public SimpleBigDecimal(BigInteger bigInt, int scale) Constructor for
| |
| add | back to summary |
|---|---|
| public SimpleBigDecimal add(SimpleBigDecimal b) | |
| add | back to summary |
|---|---|
| public SimpleBigDecimal add(BigInteger b) | |
| adjustScale | back to summary |
|---|---|
| public SimpleBigDecimal adjustScale(int newScale) | |
| checkScale | back to summary |
|---|---|
| private void checkScale(SimpleBigDecimal b) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(SimpleBigDecimal val) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(BigInteger val) | |
| divide | back to summary |
|---|---|
| public SimpleBigDecimal divide(SimpleBigDecimal b) | |
| divide | back to summary |
|---|---|
| public SimpleBigDecimal divide(BigInteger b) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| floor | back to summary |
|---|---|
| public BigInteger floor() | |
| getInstance | back to summary |
|---|---|
| public static SimpleBigDecimal getInstance(BigInteger value, int scale) Returns a
| |
| getScale | back to summary |
|---|---|
| public int getScale() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| intValue | back to summary |
|---|---|
| public int intValue() | |
| longValue | back to summary |
|---|---|
| public long longValue() | |
| multiply | back to summary |
|---|---|
| public SimpleBigDecimal multiply(SimpleBigDecimal b) | |
| multiply | back to summary |
|---|---|
| public SimpleBigDecimal multiply(BigInteger b) | |
| negate | back to summary |
|---|---|
| public SimpleBigDecimal negate() | |
| round | back to summary |
|---|---|
| public BigInteger round() | |
| shiftLeft | back to summary |
|---|---|
| public SimpleBigDecimal shiftLeft(int n) | |
| subtract | back to summary |
|---|---|
| public SimpleBigDecimal subtract(SimpleBigDecimal b) | |
| subtract | back to summary |
|---|---|
| public SimpleBigDecimal subtract(BigInteger b) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |