mirror of
https://github.com/DanilaFe/abacus
synced 2024-12-23 16:00:09 -08:00
Add comments for FUNCTION_SIN and intFactorial in StandardPlugin.
This commit is contained in:
parent
7fa28c4ebf
commit
921c176317
|
@ -282,6 +282,9 @@ public class StandardPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The sine function (the argument is interpreted in radians).
|
||||||
|
*/
|
||||||
public static final Function FUNCTION_SIN = new Function() {
|
public static final Function FUNCTION_SIN = new Function() {
|
||||||
@Override
|
@Override
|
||||||
protected boolean matchesParams(NumberInterface[] params) {
|
protected boolean matchesParams(NumberInterface[] params) {
|
||||||
|
@ -359,6 +362,13 @@ public class StandardPlugin extends Plugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A factorial function that uses memoization for each number class; it efficiently
|
||||||
|
* computes factorials of non-negative integers.
|
||||||
|
* @param numberClass type of number to return.
|
||||||
|
* @param n non-negative integer.
|
||||||
|
* @return a number of numClass with value n factorial.
|
||||||
|
*/
|
||||||
public static NumberInterface factorial(Class<? extends NumberInterface> numberClass, int n){
|
public static NumberInterface factorial(Class<? extends NumberInterface> numberClass, int n){
|
||||||
if(!factorialLists.containsKey(numberClass)){
|
if(!factorialLists.containsKey(numberClass)){
|
||||||
factorialLists.put(numberClass, new ArrayList<NumberInterface>());
|
factorialLists.put(numberClass, new ArrayList<NumberInterface>());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user