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.FunctionsGet 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 NumberPromote a number to a more specific class.voidsetInputPrecision(Long inputPrecision) Set a fixed input precision.Methods inherited from class org.apfloat.calc.FunctionCalculatorImpl
fixedFunction, fixedFunction, function, setFunctionMethods 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:CalculatorImplParse a string to an integer number.- Parameters:
value- The string to parse.- Returns:
- The number.
-
parseDecimal
Description copied from interface:CalculatorImplParse a string to a floating-point number.- Parameters:
value- The string to parse.- Returns:
- The number.
-
format
Description copied from interface:CalculatorImplConvert a number to a String. The current formatting option is used.- Parameters:
x- The number.- Returns:
- The String.
-
getFunctions
Description copied from class:FunctionCalculatorImplGet the function implementations.- Specified by:
getFunctionsin classFunctionCalculatorImpl- Parameters:
x- The number to use as the function argument.- Returns:
- The function implementations.
-
promote
Description copied from class:FunctionCalculatorImplPromote a number to a more specific class.- Specified by:
promotein classFunctionCalculatorImpl- Parameters:
x- The argument.- Returns:
- The argument, possibly converted to a more specific subclass.
-
setInputPrecision
Description copied from interface:CalculatorImplSet a fixed input precision.- Specified by:
setInputPrecisionin interfaceCalculatorImpl- Overrides:
setInputPrecisionin classAbstractCalculatorImpl- Parameters:
inputPrecision- The precision if a fixed precision is used ornullfor arbitrary precision.
-