1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-11-17 16:09:32 -08:00

Add pow function.

This commit is contained in:
Arthur Drobot 2017-07-27 13:17:22 -07:00
parent 18a5a99887
commit 950e3503b7

View File

@ -201,6 +201,18 @@ public class StandardPlugin extends Plugin {
return sum;
}
});
registerFunction("pow", new Function() {
@Override
protected boolean matchesParams(NumberInterface[] params) {
return params.length == 2;
}
@Override
protected NumberInterface applyInternal(NumberInterface[] params) {
return StandardPlugin.this.getFunction("exp").apply(StandardPlugin.this.getFunction("ln").apply(params[0]).multiply(params[1]));
}
});
}
/**