Package ch.obermuhlner.math.big.internal
Class PowerTwoNIterator
- java.lang.Object
-
- ch.obermuhlner.math.big.internal.PowerTwoNIterator
-
- All Implemented Interfaces:
PowerIterator
public class PowerTwoNIterator extends java.lang.Object implements PowerIterator
PowerIterator
to calculate x2*n.
-
-
Field Summary
Fields Modifier and Type Field Description private java.math.MathContext
mathContext
private java.math.BigDecimal
powerOfX
private java.math.BigDecimal
xPowerTwo
-
Constructor Summary
Constructors Constructor Description PowerTwoNIterator(java.math.BigDecimal x, java.math.MathContext mathContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calculateNextPower()
Calculates the next power.java.math.BigDecimal
getCurrentPower()
Returns the current power.
-
-
-
Method Detail
-
getCurrentPower
public java.math.BigDecimal getCurrentPower()
Description copied from interface:PowerIterator
Returns the current power.- Specified by:
getCurrentPower
in interfacePowerIterator
- Returns:
- the current power.
-
calculateNextPower
public void calculateNextPower()
Description copied from interface:PowerIterator
Calculates the next power.- Specified by:
calculateNextPower
in interfacePowerIterator
-
-