mirror of
https://github.com/DanilaFe/abacus
synced 2024-11-18 00:19:32 -08:00
Remove the correct unused intPow function.
This commit is contained in:
parent
4146e1a439
commit
5a1a05ddad
|
@ -531,22 +531,6 @@ public class StandardPlugin extends Plugin {
|
||||||
return theta;
|
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
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
registerNumberImplementation("naive", IMPLEMENTATION_NAIVE);
|
registerNumberImplementation("naive", IMPLEMENTATION_NAIVE);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user