Creates an instance of Component class. This is not the recommended way of creating new Component instances. For end users it is recommended that they use the Component.create function instead.
The value of the number in the required format.
The decimal part of the number.
The integer part of the number.
The constant Euler's number (\( e \)) correct up to 100 decimal places.
The constant eight.
The constant five.
The constant four.
The constant nine.
The constant one.
The circle constant \( \pi \) correct up to 100 decimal places.
The constant seven.
The constant six.
The constant three.
The constant two.
The constant zero.
The natural logarithm of \( 10 \) correct up to 100 decimal places. This comes in very handy for natural base to common base logarithm.
The natural logarithm of \( 2 \) correct up to 100 decimal places.
Returns the class whose object this
is.
The negative value of this
.
The sign of this number.
Adds two Component instances. The higher precision value of the two is chosen as the precision for the result and rounding is according to mathenv.mode.
The number to add this with.
this + that.
Adds two Component instances. The higher precision value of the two is chosen as the precision for the result and rounding is according to the given context settings.
The number to add this with.
The context settings object to use.
this + that.
The comparator function. This compares this
to that
and returns
this
> that
this
< that
Number to compare with.
Divides one Component instance by another with rounding according to mathenv.mode.
The number to divide this by.
this / that.
Divides one Component instance by another with rounding according to the given context settings.
The number to divide this by.
The context settings object to use.
this / that.
Checks whether this
and that
are equal numbers. Equality is checked
only till the number of decimal places specified by mathenv.mode.
The number to check against.
Checks whether this
and that
are equal numbers. Equality is checked
only till the number of decimal places specified by context
.
The number to check against.
The MathContext value to use for equality check.
Checks whether a method exists on the object or as a static member of the class.
Name of the method.
Determines whether this
is less than or equal to that
. Equality is
check according to mathenv.mode.
Number to compare with.
Determines whether this
is less than or equal to that
. Equality is
checked according to the given context settings.
Number to compare with.
The context settings to use.
Determines whether this
is less than that
.
Number to compare with.
The modulo operator. The extended definition for non-integer numbers has been used. For two numbers \( a \) and \( b \), \[ a \bmod b = a - b \left\lfloor \frac{a}{b} \right\rfloor \] The result is rounded according to mathenv.mode.
A number.
The modulo operator. The extended definition for non-integer numbers has been used. For two numbers \( a \) and \( b \), \[ a \bmod b = a - b \left\lfloor \frac{a}{b} \right\rfloor \] The result is rounded according to the given context.
A number.
The context settings to use.
Determines whether this
is more than or equal to that
. Equality is
checked according to mathenv.mode.
Number to compare with.
Determines whether this
is more than or equal to that
. Equality is
checked according to the given context.
Number to compare with.
The context settings to use.
Determines whether this
is more than that
.
Number to compare with.
Multiplies two Component instances. The sum of the precisions of the two is chosen as the precision of the result and rounding is according to mathenv.mode.
The number to multiply this with.
this * that.
Multiplies two Component instances. The sum of the precisions of the two is chosen as the precision of the result and rounding is according to the given context settings.
The number to multiply this with.
The context settings object to use.
this * that.
Raises this
to the power of ex
.
A number.
Raises this
to the power of ex
using the rounding according to the
given context settings.
A number.
The context settings object to use.
Subtracts one Component instance from another. The higher precision value of the two is chosen as the precision for the result and rounding is according to mathenv.mode.
The number to subtract from this.
this - that.
Subtracts one Component instance from another. The higher precision value of the two is chosen as the precision for the result and rounding is according to the given context settings.
The number to subtract from this.
The context settings object to use.
this - that.
The canonical representation of the number as a string.
The string representation of this
.
Calculates the inverse trigonometric cosine of a number with rounding according to mathenv.mode.
A number.
Calculates the inverse trigonometric cosine of a number with rounding according to the given context.
A number.
The context settings to use.
Calculates the inverse hyperbolic cosine with rounding according to mathenv.mode.
A number.
Calculates the inverse hyperbolic cosine with rounding according to the given context.
A number.
The context settings to use.
Calculates the inverse trigonometric sine of a number with rounding according to mathenv.mode.
A number.
Calculates the inverse trigonometric sine of a number with rounding according to the given context.
A number.
The context settings to use.
Calculates the inverse hyperbolic sine with rounding according to mathenv.mode.
A number.
Calculates the inverse hyperbolic sine with rounding according to the given context.
A number.
The context settings to use.
Calculates the inverse trigonometric tangent of a number with rounding according to mathenv.mode.
A number.
Calculates the inverse trigonometric tangent of a number with rounding according to the given context.
A number.
The context settings to use.
Calculates the solution for \( \theta \) for the set of equations
\[ \begin{align} x &= r \cos \theta \\ y &= r \sin \theta \end{align} \]
with rounding according to mathenv.mode.
Calculates the solution for \( \theta \) for the set of equations
\[ \begin{align} x &= r \cos \theta \\ y &= r \sin \theta \end{align} \]
with rounding according to the given context.
A number.
The context settings to use.
Calculates the inverse hyperbolic sine with rounding according to mathenv.mode.
A number.
Calculates the inverse hyperbolic sine with rounding according to the given context.
A number.
The context settings to use.
Calculates the trigonometric cosine with rounding according to mathenv.mode.
A number.
Calculates the trigonometric cosine with rounding according to the given context.
A number.
The context settings to use.
Calculates the hyperbolic cosine with rounding according to mathenv.mode.
A number.
Calculates the hyperbolic cosine with rounding according to the given context.
A number.
The context settings to use.
Creates a Component instance from the string representation of the number.
The string representation of the number in decimal system.
Creates a Component instance from the decimal representation of the
number. This instance created will store the exact binary floating
point value of the number. Even though it uses the toString()
method
to convert the number to a string it might be unpredictable at times.
A numeric expression.
Creates a Component instance from the integral and fractional part of the number. Both the arguments are expected to be string representations of integers.
The whole part of the number.
The fractional part of the number.
Calculates the exponential of a given number with rounding according to mathenv.mode.
A number.
Calculates the exponential of a given number with rounding according to the given context settings.
A number
The context settings to use.
Raises a Component to an integer power. This function may be made private in future versions. It is advised not to use this function except for development purposes.
The base number.
The index / exponent to which the base is to be raised.
The context settings to use.
The number of decimal places a BigNum object should store. This does not represent the number of significant digits in the number unlike the JAVA implementation of the same concept.
The rounding algorithm that should be used for a particular numerical operation. Care must be taken as to when the UNNECESSARY mode is used, it will throw an exception if an exact representation of the result is not found.
Calculates the natural logarithm (to the base \( e \)) of a given number with rounding according to mathenv.mode.
A number.
Calculates the natural logarithm (to the base \( e \)) of a given number with rounding according to the given context settings.
A number.
The context settings to use.
Rounds off a given number according to some MathContext. The different rounding algorithms implemented are heavily influenced by the Java implementation of the same.
The number to round off.
The MathContext which defines how the number is to be rounded.
The number representing the rounded value of the argument according to the given context.
Calculates the trigonometric sine with rounding according to mathenv.mode.
A number.
Calculates the trigonometric sine with rounding according to the given context.
A number.
The context settings to use.
Calculates the hyperbolic sine with rounding according to mathenv.mode.
A number.
Calculates the hyperbolic sine with rounding according to the given context.
A number.
The context settings to use.
Calculates the trigonometric tangent with rounding according to mathenv.mode.
A number.
Calculates the trigonometric tangent with rounding according to the given context.
A number.
The context settings to use.
Calculates the hyperbolic tangent with rounding according to mathenv.mode.
A number.
Calculates the hyperbolic tangent with rounding according to the given context.
A number.
The context settings to use.
Generated using TypeDoc
Immutable, arbitrary precision decimal numbers. A Component consists of an integer part and a decimal part stored as string objects. The precision of the number is completely controlled by the user. A MathContext object helps to specify the number of decimal places (not significant figures) the user wants and what rounding algorithm should be used. Every operation is carried out by an intermediate result which is then rounded to the preferred number of decimal places using the preferred rounding algorithm.