Method Summary |
|
public Real | abs() Returns the absolute value of this real number. |
public boolean | approximates(Real that) Indicates if this real approximates the one specified. |
public int | compareTo(Real that) Compares two real numbers numerically.
Parameters: that - the real to compare with. |
public Real | copy() |
public Real | divide(long divisor) Returns this real number divided by the specified int
divisor. |
public Real | divide(Real that) Returns this real number divided by the one specified.
Parameters: that - the real divisor. |
public double | doubleValue() Returns the value of this real number as a double . |
public boolean | equals(Object that) Compares this real number against the specified object.
Note: This method returns true if this or
that
Real.isNaN is Not-A-Number , even though
Double.NaN == Double.NaN has the value
false .
Parameters: that - the object to compare with. |
public int | getAccuracy() Returns the number of decimal digits guaranteed exact which appear to
the right of the decimal point (absolute error). |
public int | getError() Returns the maximum error (positive) on this real significand. |
public static int | getExactPrecision() Returns the
javolution.context.LocalContext local minimum
precision (number of exact digits) when exact numbers have to be
approximated. |
public int | getExponent() Returns the exponent of the power of 10 multiplier. |
final public int | getPrecision() Returns the total number of decimal digits guaranteed exact
(relative error). |
public LargeInteger | getSignificand() Returns this real
significand value. |
public int | hashCode() Returns the hash code for this real number. |
public Real | inverse() Returns the reciprocal (or inverse) of this real number. |
public boolean | isExact() Indicates if this real number is exact (
Real.getError() error
== 0 ). |
public boolean | isLargerThan(Real that) Compares the absolute value of two real numbers.
Parameters: that - the real number to be compared with. |
public boolean | isNaN() Indicates if this real is Not-a-Number (unbounded value interval). |
public boolean | isNegative() Indicates if this real is less than zero. |
public boolean | isPositive() Indicates if this real is greater than zero. |
public long | longValue() Returns the value of this real number as a long . |
public Real | minus(Real that) Returns the difference between this real number and the one
specified.
Parameters: that - the real to be subtracted. |
public Real | opposite() Returns the negation of this real number. |
public Real | plus(Real that) Returns the sum of this real number with the one specified.
Parameters: that - the real to be added. |
public LargeInteger | round() Returns the closest integer value to this rational number. |
public static void | setExactPrecision(int precision) Sets the
javolution.context.LocalContext local minimum precision
(number of exact digits) when exact numbers have to be approximated. |
public Real | sqrt() Returns the square root of this real number, the more accurate is this
real number, the more accurate the square root. |
public Real | times(long multiplier) Returns the product of this real number with the specified
long multiplier.
Parameters: multiplier - the long multiplier. |
public Real | times(Real that) Returns the product of this real number with the one specified.
Parameters: that - the real multiplier. |
public Text | toText() Returns the decimal text representation of this number. |
public static Real | valueOf(LargeInteger significand, int error, int exponent) Returns a real having the specified significand, error and exponent values.
If the error is 0 , the real is assumed exact. |
public static Real | valueOf(double doubleValue) Returns the real number (inexact except for 0.0 )
corresponding to the specified double value. |
public static Real | valueOf(long longValue) Returns the exact real number corresponding to the specified
long value (convenience method). |
public static Real | valueOf(CharSequence chars) Returns the real for the specified character sequence.
If the precision is not specified (using the ± symbol),
the real is supposed exact. |