From 48839a3b5d0280eb1bffbed7f1aa9f479dc8c9b8 Mon Sep 17 00:00:00 2001 From: Arthur Drobot Date: Fri, 4 Aug 2017 10:33:55 -0700 Subject: [PATCH] Check arguments in factorial function. --- src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java b/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java index 8165588..2e98b87 100755 --- a/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java +++ b/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java @@ -97,7 +97,9 @@ public class StandardPlugin extends Plugin { //private HashMap, ArrayList> storedList = new HashMap, ArrayList>(); @Override protected boolean matchesParams(NumberInterface[] params) { - return params.length == 1; + return params.length == 1 + && params[0].fractionalPart().compareTo(NaiveNumber.ZERO.promoteTo(params[0].getClass())) == 0 + && params[0].signum() >= 0; } @Override