Package ch.obermuhlner.math.big.internal
Class ExpCalculator
java.lang.Object
ch.obermuhlner.math.big.internal.SeriesCalculator
ch.obermuhlner.math.big.internal.ExpCalculator
Calculates exp using the Maclaurin series.
No argument checking or optimizations are done. This implementation is not intended to be called directly.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Calculates the factor of the next term.protected PowerIterator
createPowerIterator
(BigDecimal x, MathContext mathContext) Creates thePowerIterator
used for this series.protected BigRational
Returns the factor of the highest term already calculated.Methods inherited from class ch.obermuhlner.math.big.internal.SeriesCalculator
calculate, getFactor
-
Field Details
-
INSTANCE
-
n
private int n -
oneOverFactorialOfN
-
-
Constructor Details
-
ExpCalculator
private ExpCalculator()
-
-
Method Details
-
getCurrentFactor
Description copied from class:SeriesCalculator
Returns the factor of the highest term already calculated.When called for the first time will return the factor of the first term (index 0).
After this call the method
SeriesCalculator.calculateNextFactor()
will be called to prepare for the next term.- Specified by:
getCurrentFactor
in classSeriesCalculator
- Returns:
- the factor of the highest term
-
calculateNextFactor
protected void calculateNextFactor()Description copied from class:SeriesCalculator
Calculates the factor of the next term.- Specified by:
calculateNextFactor
in classSeriesCalculator
-
createPowerIterator
Description copied from class:SeriesCalculator
Creates thePowerIterator
used for this series.- Specified by:
createPowerIterator
in classSeriesCalculator
- Parameters:
x
- the value xmathContext
- theMathContext
- Returns:
- the
PowerIterator
-