Package org.apfloat.calc
Class ApfloatCalculatorImpl
java.lang.Object
org.apfloat.calc.AbstractCalculatorImpl
org.apfloat.calc.FunctionCalculatorImpl
org.apfloat.calc.ApfloatCalculatorImpl
- All Implemented Interfaces:
Serializable
,CalculatorImpl
Arbitrary precision calculator implementation.
- Version:
- 1.14.0
- Author:
- Mikko Tommila
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apfloat.calc.FunctionCalculatorImpl
FunctionCalculatorImpl.FixedFunction, FunctionCalculatorImpl.FixedFunctionHandler, FunctionCalculatorImpl.Function, FunctionCalculatorImpl.Functions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConvert a number to a String.protected FunctionCalculatorImpl.Functions
Get the function implementations.parseDecimal
(String value) Parse a string to a floating-point number.parseInteger
(String value) Parse a string to an integer number.protected Number
Promote a number to a more specific class.void
setInputPrecision
(Long inputPrecision) Set a fixed input precision.Methods inherited from class org.apfloat.calc.FunctionCalculatorImpl
fixedFunction, fixedFunction, function, setFunction
Methods inherited from class org.apfloat.calc.AbstractCalculatorImpl
add, divide, doubleFactorial, factorial, getFormat, getInputPrecision, getVariable, mod, multiply, negate, pow, setFormat, setVariable, subtract
-
Constructor Details
-
ApfloatCalculatorImpl
public ApfloatCalculatorImpl()Default constructor.
-
-
Method Details
-
parseInteger
Description copied from interface:CalculatorImpl
Parse a string to an integer number.- Parameters:
value
- The string to parse.- Returns:
- The number.
-
parseDecimal
Description copied from interface:CalculatorImpl
Parse a string to a floating-point number.- Parameters:
value
- The string to parse.- Returns:
- The number.
-
format
Description copied from interface:CalculatorImpl
Convert a number to a String. The current formatting option is used.- Parameters:
x
- The number.- Returns:
- The String.
-
getFunctions
Description copied from class:FunctionCalculatorImpl
Get the function implementations.- Specified by:
getFunctions
in classFunctionCalculatorImpl
- Parameters:
x
- The number to use as the function argument.- Returns:
- The function implementations.
-
promote
Description copied from class:FunctionCalculatorImpl
Promote a number to a more specific class.- Specified by:
promote
in classFunctionCalculatorImpl
- Parameters:
x
- The argument.- Returns:
- The argument, possibly converted to a more specific subclass.
-
setInputPrecision
Description copied from interface:CalculatorImpl
Set a fixed input precision.- Specified by:
setInputPrecision
in interfaceCalculatorImpl
- Overrides:
setInputPrecision
in classAbstractCalculatorImpl
- Parameters:
inputPrecision
- The precision if a fixed precision is used ornull
for arbitrary precision.
-