1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-06-18 00:37:06 -07:00

Add pow function.

This commit is contained in:
Arthur Drobot 2017-07-27 13:17:22 -07:00
parent ba30227b28
commit 9666ef9019

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]));
}
});
}
/**