1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-10-01 10:50:50 -07:00

Check arguments in factorial function.

This commit is contained in:
Arthur Drobot 2017-08-04 10:33:55 -07:00
parent c6afcfeb4f
commit 48839a3b5d

View File

@ -97,7 +97,9 @@ public class StandardPlugin extends Plugin {
//private HashMap<Class<? extends NumberInterface>, ArrayList<NumberInterface>> storedList = new HashMap<Class<? extends NumberInterface>, ArrayList<NumberInterface>>();
@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