Package ch.obermuhlner.math.big.internal
Interface PowerIterator
-
- All Known Implementing Classes:
PowerNIterator
,PowerTwoNIterator
,PowerTwoNMinusOneIterator
,PowerTwoNPlusOneIterator
public interface PowerIterator
Iterator over the powers of a value x.This API allows to efficiently calculate the various powers of x in a taylor series by storing intermediate results.
For example xn can be calculated using one multiplication by storing the previously calculated xn-1 and x.
For later iterationsgetCurrentPower()
will be called first to retrieve the initial value.calculateNextPower()
will be called beforegetCurrentPower()
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
calculateNextPower()
Calculates the next power.java.math.BigDecimal
getCurrentPower()
Returns the current power.
-