@API(status=INTERNAL) public final class Calculator extends Object
Numbers utilizing a provided NumberSystem.| Modifier and Type | Method and Description |
|---|---|
Calculator |
abs()
Calculates the absolute value of this
Calculator´s accumulator,
then stores the result in the accumulator. |
Calculator |
add(Number number)
Adds
number to this Calculator´s accumulator,
then stores the result in the accumulator. |
Calculator |
divide(Number number)
Divides this
Calculator´s accumulator by number,
then stores the result in the accumulator. |
Calculator |
exp()
Calculates Euler's constant taken to the power of this
Calculator´s accumulator,
then stores the result in the accumulator. |
boolean |
isLessThanOne() |
Calculator |
log()
Calculates the natural logarithm of this
Calculator´s accumulator,
then stores the result in the accumulator. |
Calculator |
multiply(Number number)
Multiplies
number with this Calculator´s accumulator,
then stores the result in the accumulator. |
Calculator |
negate()
Calculates the additive inverse value of this
Calculator´s accumulator,
then stores the result in the accumulator. |
static Calculator |
of(Number number)
Shortcut for
getDefault().load(number). |
Number |
peek()
Allows to 'peek' at this
Calculator´s accumulator. |
Calculator |
power(int exponent)
Takes this
Calculator´s accumulator to the integer power of exponent,
then stores the result in the accumulator. |
Calculator |
reciprocal()
Calculates the multiplicative inverse value of this
Calculator´s accumulator,
then stores the result in the accumulator. |
Calculator |
subtract(Number number)
Subtracts
number from this Calculator´s accumulator,
then stores the result in the accumulator. |
public static Calculator of(Number number)
number - Calculator with number loaded into its accumulatorpublic Calculator add(Number number)
number to this Calculator´s accumulator,
then stores the result in the accumulator.number - public Calculator subtract(Number number)
number from this Calculator´s accumulator,
then stores the result in the accumulator.number - public Calculator multiply(Number number)
number with this Calculator´s accumulator,
then stores the result in the accumulator.number - public Calculator divide(Number number)
Calculator´s accumulator by number,
then stores the result in the accumulator.number - public Calculator power(int exponent)
Calculator´s accumulator to the integer power of exponent,
then stores the result in the accumulator.exponent - public Calculator abs()
Calculator´s accumulator,
then stores the result in the accumulator.public Calculator negate()
Calculator´s accumulator,
then stores the result in the accumulator.public Calculator reciprocal()
Calculator´s accumulator,
then stores the result in the accumulator.public Calculator exp()
Calculator´s accumulator,
then stores the result in the accumulator.public Calculator log()
Calculator´s accumulator,
then stores the result in the accumulator.public Number peek()
Calculator´s accumulator. The Number returned is narrowed
to best represent the numerical value w/o loss of precision within the NumberSystem as
configured for this Calculator instance.Calculator´s accumulatorpublic boolean isLessThanOne()
Calculator´s accumulator is less than ONECopyright © 2005–2022 Units of Measurement project. All rights reserved.