This class is a simple wrapper around the standard BigDecimal
in order to implement the FieldElement interface.
| Modifier and Type | Field and Description |
|---|---|
| private final BigDecimal | d
Underlying BigDecimal. |
| public static final BigReal | ONE
A big real representing 1. |
| private RoundingMode | roundingMode
Rounding mode for divisions. |
| private int | scale
BigDecimal scale |
| private static final long | serialVersionUID
Serializable version identifier. |
| public static final BigReal | ZERO
A big real representing 0. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | BigReal(BigInteger
unscaled value unscaledVal, int scale to use scale)Build an instance from an unscaled BigInteger. |
| public | BigReal(BigInteger
unscaled value unscaledVal, int scale to use scale, MathContext to used mc)Build an instance from an unscaled BigInteger. |
| public | BigReal(BigInteger
value of the instance val, MathContext context to use mc)Build an instance from a BigInteger. |
| public | BigReal(char[]
character representation of the value in)Build an instance from a characters representation. |
| public | BigReal(char[]
character representation of the value in, int offset of the first character to analyze offset, int length of the array slice to analyze len)Build an instance from a characters representation. |
| public | BigReal(char[]
character representation of the value in, int offset of the first character to analyze offset, int length of the array slice to analyze len, MathContext context to use mc)Build an instance from a characters representation. |
| public | BigReal(char[]
character representation of the value in, MathContext context to use mc)Build an instance from a characters representation. |
| public | |
| public | BigReal(double
value of the instance val, MathContext context to use mc)Build an instance from a double. |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | BigReal(String
character representation of the value val, MathContext context to use mc)Build an instance from a String representation. |
| Modifier and Type | Method and Description |
|---|---|
| public BigReal | |
| public BigDecimal | Returns: BigDecimal value corresponding to the instanceGet the BigDecimal value corresponding to the instance. |
| public int | compareTo(BigReal
the object to be compared. a)Implements java. Compares this object with the specified object for order. |
| public BigReal | divide(BigReal
element to divide by a)Implements org. Compute this ÷ a. |
| public double | Returns: double value corresponding to the instanceGet the double value corresponding to the instance. |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public Field | getField()
Implements org. Get the |
| public RoundingMode | Returns: the rounding mode.Gets the rounding mode for division operations
The default is |
| public int | |
| public int | |
| public BigReal | multiply(BigReal
element to multiply a)Implements org. Compute this × a. |
| public BigReal | multiply(final int
Number of times n)this must be added to itself.Implements org. Compute n × this.</center> |
| public BigReal | negate()
Implements org. Returns the additive inverse of |
| public BigReal | reciprocal()
Implements org. Returns the multiplicative inverse of |
| public void | setRoundingMode(RoundingMode
rounding mode for decimal divisions roundingMode)Sets the rounding mode for decimal divisions. |
| public void | |
| public BigReal | subtract(BigReal
element to subtract a)Implements org. Compute this - a. |
| d | back to summary |
|---|---|
| private final BigDecimal d Underlying BigDecimal. | |
| ONE | back to summary |
|---|---|
| public static final BigReal ONE A big real representing 1. | |
| roundingMode | back to summary |
|---|---|
| private RoundingMode roundingMode Rounding mode for divisions. | |
| scale | back to summary |
|---|---|
| private int scale BigDecimal scale | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serializable version identifier. | |
| ZERO | back to summary |
|---|---|
| public static final BigReal ZERO A big real representing 0. | |
| BigReal | back to summary |
|---|---|
| public BigReal(BigDecimal val) Build an instance from a BigDecimal.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(BigInteger val) Build an instance from a BigInteger.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(BigInteger unscaledVal, int scale) Build an instance from an unscaled BigInteger.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(BigInteger unscaledVal, int scale, MathContext mc) Build an instance from an unscaled BigInteger.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(BigInteger val, MathContext mc) Build an instance from a BigInteger.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(char[] in) Build an instance from a characters representation.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(char[] in, int offset, int len) Build an instance from a characters representation.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(char[] in, int offset, int len, MathContext mc) Build an instance from a characters representation.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(char[] in, MathContext mc) Build an instance from a characters representation.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(double val) Build an instance from a double.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(double val, MathContext mc) Build an instance from a double.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(int val) Build an instance from an int.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(int val, MathContext mc) Build an instance from an int.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(long val) Build an instance from a long.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(long val, MathContext mc) Build an instance from a long.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(String val) Build an instance from a String representation.
| |
| BigReal | back to summary |
|---|---|
| public BigReal(String val, MathContext mc) Build an instance from a String representation.
| |
| add | back to summary |
|---|---|
| public BigReal add(BigReal a) Implements org. Doc from org. Compute this + a. | |
| bigDecimalValue | back to summary |
|---|---|
| public BigDecimal bigDecimalValue() Get the BigDecimal value corresponding to the instance.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(BigReal a) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| divide | back to summary |
|---|---|
| public BigReal divide(BigReal a) throws MathArithmeticException Implements org. Doc from org. Compute this ÷ a.
| |
| doubleValue | back to summary |
|---|---|
| public double doubleValue() Get the double value corresponding to the instance.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) 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. | |
| getField | back to summary |
|---|---|
| public Field Implements org. Doc from org. Get the | |
| getRoundingMode | back to summary |
|---|---|
| public RoundingMode getRoundingMode() Gets the rounding mode for division operations
The default is
| |
| getScale | back to summary |
|---|---|
| public int getScale() Sets the scale for division operations. The default is 64
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| multiply | back to summary |
|---|---|
| public BigReal multiply(BigReal a) Implements org. Doc from org. Compute this × a. | |
| multiply | back to summary |
|---|---|
| public BigReal multiply(final int n) Implements org. Doc from org. Compute n × this. Multiplication by an integer number is defined as the following sum
| |
| negate | back to summary |
|---|---|
| public BigReal negate() Implements org. Doc from org. Returns the additive inverse of
| |
| reciprocal | back to summary |
|---|---|
| public BigReal reciprocal() throws MathArithmeticException Implements org. Doc from org. Returns the multiplicative inverse of
| |
| setRoundingMode | back to summary |
|---|---|
| public void setRoundingMode(RoundingMode roundingMode) Sets the rounding mode for decimal divisions.
| |
| setScale | back to summary |
|---|---|
| public void setScale(int scale) Sets the scale for division operations.
| |
| subtract | back to summary |
|---|---|
| public BigReal subtract(BigReal a) Implements org. Doc from org. Compute this - a. | |