From a8c70a6bbe1ccb914716ada04710fa93e00bb81e Mon Sep 17 00:00:00 2001 From: Arthur Drobot Date: Mon, 7 Aug 2017 14:05:15 -0700 Subject: [PATCH] Add checking of negative bases raised to non-integer powers in matchesParams in OP_CARET. --- src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java | 3 ++- 1 file changed, 2 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 62a732f..e085e07 100755 --- a/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java +++ b/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java @@ -340,7 +340,8 @@ public class StandardPlugin extends Plugin { protected boolean matchesParams(NumberInterface[] params) { return params.length == 2 && !(params[0].compareTo(NaiveNumber.ZERO.promoteTo(params[0].getClass())) == 0 - && params[1].compareTo(NaiveNumber.ZERO.promoteTo(params[1].getClass())) == 0); + && params[1].compareTo(NaiveNumber.ZERO.promoteTo(params[1].getClass())) == 0) + && !(params[0].signum() == -1 && params[1].fractionalPart().compareTo(NaiveNumber.ZERO.promoteTo(params[1].getClass())) != 0); } @Override