1
0
mirror of https://github.com/DanilaFe/abacus synced 2026-01-27 17:15:21 +00:00

Revert "Remove the NumberInterface::intPow method."

0c16bb4e9b
This commit is contained in:
2017-08-05 18:22:43 -07:00
parent 4f94700aef
commit bae6ee5526
4 changed files with 57 additions and 4 deletions

View File

@@ -134,6 +134,27 @@ public abstract class NumberInterface {
return negateInternal();
}
/**
* Raises this number to an integer power.
*
* @param exponent the exponent to which to take the number.
* @return the resulting value.
*/
protected abstract NumberInterface intPowInternal(int exponent);
/**
* Raises this number to an integer power. Also, checks if the
* thread has been interrupted, and if so, throws
* an exception.
*
* @param exponent the exponent to which to take the number.
* @return the resulting value.
*/
public final NumberInterface intPow(int exponent){
checkInterrupted();
return intPowInternal(exponent);
}
/**
* Compares this number to another.
*