Package org.apfloat.calc
Class ApfloatCalculatorImpl
- java.lang.Object
-
- org.apfloat.calc.AbstractCalculatorImpl
-
- org.apfloat.calc.FunctionCalculatorImpl
-
- org.apfloat.calc.ApfloatCalculatorImpl
-
- All Implemented Interfaces:
java.io.Serializable
,CalculatorImpl
public class ApfloatCalculatorImpl extends FunctionCalculatorImpl
Arbitrary precision calculator implementation.- Version:
- 1.14.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ApfloatCalculatorImpl.ApcomplexFunctions
private class
ApfloatCalculatorImpl.ApfloatFunctions
private class
ApfloatCalculatorImpl.ApintFunctions
private class
ApfloatCalculatorImpl.AprationalFunctions
-
Nested classes/interfaces inherited from class org.apfloat.calc.FunctionCalculatorImpl
FunctionCalculatorImpl.FixedFunction, FunctionCalculatorImpl.FixedFunctionHandler, FunctionCalculatorImpl.Function, FunctionCalculatorImpl.Functions
-
-
Field Summary
Fields Modifier and Type Field Description private FixedPrecisionApcomplexHelper
fixedPrecisionApcomplexHelper
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description ApfloatCalculatorImpl()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private <T extends java.lang.Number,U extends Apcomplex>
java.lang.NumberfixedOrArbitraryPrecision(java.util.function.BiFunction<T,U,Apcomplex> fixedPrecisionFunction, java.util.function.BiFunction<T,U,Apcomplex> arbitraryPrecisionFunction, T x, U y)
private java.lang.Number
fixedOrArbitraryPrecision(java.util.function.Function<Apcomplex,Apcomplex> fixedPrecisionFunction, java.util.function.Function<Apcomplex,Apcomplex> arbitraryPrecisionFunction, java.lang.Number x)
java.lang.String
format(java.lang.Number x)
Convert a number to a String.protected FunctionCalculatorImpl.Functions
getFunctions(java.lang.Number x)
Get the function implementations.java.lang.Number
parseDecimal(java.lang.String value)
Parse a string to a floating-point number.java.lang.Number
parseInteger(java.lang.String value)
Parse a string to an integer number.protected java.lang.Number
promote(java.lang.Number x)
Promote a number to a more specific class.void
setInputPrecision(java.lang.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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
fixedPrecisionApcomplexHelper
private FixedPrecisionApcomplexHelper fixedPrecisionApcomplexHelper
-
-
Method Detail
-
parseInteger
public java.lang.Number parseInteger(java.lang.String value)
Description copied from interface:CalculatorImpl
Parse a string to an integer number.- Parameters:
value
- The string to parse.- Returns:
- The number.
-
parseDecimal
public java.lang.Number parseDecimal(java.lang.String value)
Description copied from interface:CalculatorImpl
Parse a string to a floating-point number.- Parameters:
value
- The string to parse.- Returns:
- The number.
-
format
public java.lang.String format(java.lang.Number x)
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
protected FunctionCalculatorImpl.Functions getFunctions(java.lang.Number x)
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
protected java.lang.Number promote(java.lang.Number x)
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
public void setInputPrecision(java.lang.Long inputPrecision)
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.
-
fixedOrArbitraryPrecision
private java.lang.Number fixedOrArbitraryPrecision(java.util.function.Function<Apcomplex,Apcomplex> fixedPrecisionFunction, java.util.function.Function<Apcomplex,Apcomplex> arbitraryPrecisionFunction, java.lang.Number x)
-
-