From 921c17631762cb1c79471d379b5d8fbeacaf8b44 Mon Sep 17 00:00:00 2001 From: Arthur Drobot Date: Wed, 2 Aug 2017 15:13:04 -0700 Subject: [PATCH] Add comments for FUNCTION_SIN and intFactorial in StandardPlugin. --- .../java/org/nwapw/abacus/plugin/StandardPlugin.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java b/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java index a20f5c4..c916c7c 100755 --- a/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java +++ b/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java @@ -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() { @Override 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 numberClass, int n){ if(!factorialLists.containsKey(numberClass)){ factorialLists.put(numberClass, new ArrayList());