1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-11-04 18:08:31 -08:00

Remove the correct unused intPow function.

This commit is contained in:
Danila Fedorin 2017-08-05 18:23:24 -07:00
parent bae6ee5526
commit 9f61fc5dbe

View File

@ -531,22 +531,6 @@ public class StandardPlugin extends Plugin {
return theta;
}
public static NumberInterface intPow(NumberInterface number, Class<? extends NumberInterface> numberClass, NumberInterface exponent) {
if (exponent.compareTo((new NaiveNumber(0)).promoteTo(numberClass)) == 0) {
return (new NaiveNumber(1)).promoteTo(numberClass);
}
boolean takeReciprocal = exponent.compareTo((new NaiveNumber(0)).promoteTo(numberClass)) < 0;
exponent = FUNCTION_ABS.apply(exponent);
NumberInterface power = number;
for (NumberInterface currentExponent = (new NaiveNumber(1)).promoteTo(numberClass); currentExponent.compareTo(exponent) < 0; currentExponent = currentExponent.add((new NaiveNumber(1)).promoteTo(numberClass))) {
power = power.multiply(number);
}
if (takeReciprocal) {
power = (new NaiveNumber(1)).promoteTo(numberClass).divide(power);
}
return power;
}
@Override
public void onEnable() {
registerNumberImplementation("naive", IMPLEMENTATION_NAIVE);