From 6a29851618e063d6b7d27c2de49025eac8c80cfe Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 4 Aug 2017 14:54:01 -0700 Subject: [PATCH] Fix caret just multiplying. --- src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java b/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java index 4cd75ce..e82ca2e 100755 --- a/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java +++ b/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java @@ -378,15 +378,15 @@ public class StandardPlugin extends Plugin { @Override protected NumberInterface applyInternal(NumberInterface[] params) { - NumberInterface check; if (Thread.currentThread().isInterrupted()) return null; else if (params[0].compareTo(NaiveNumber.ZERO.promoteTo(params[0].getClass())) == 0) return NaiveNumber.ZERO.promoteTo(params[0].getClass()); else if (params[1].compareTo(NaiveNumber.ZERO.promoteTo(params[0].getClass())) == 0) return NaiveNumber.ONE.promoteTo(params[1].getClass()); - if ((check = FUNCTION_EXP.apply(FUNCTION_LN.apply(params[0]))) != null && (check = check.multiply(params[1])) != null) - return check; - return null; + FUNCTION_EXP.apply(FUNCTION_LN.apply(FUNCTION_ABS.apply(params[0])).multiply(params[1])); + NumberInterface check = FUNCTION_LN.apply(FUNCTION_ABS.apply(params[0])); + if(check == null) return null; + return FUNCTION_EXP.apply(check.multiply(params[1])); } }); /**