public interface PowerIterator
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.
getCurrentPower()
will be called first to retrieve the initial value.
calculateNextPower()
will be called before getCurrentPower()
.Modifier and Type | Method and Description |
---|---|
void |
calculateNextPower()
Calculates the next power.
|
java.math.BigDecimal |
getCurrentPower()
Returns the current power.
|