From f5fa890c4f885946aecd94f2ed1c07acff524a0b Mon Sep 17 00:00:00 2001 From: Arthur Drobot Date: Wed, 2 Aug 2017 15:33:34 -0700 Subject: [PATCH] Fix scaling for optimization in FUNCTION_LN, in the positive direction towards unity (i.e., when the argument passed to ln is small). --- src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java | 2 +- 1 file changed, 1 insertion(+), 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 bbbab5a..d7b14f3 100755 --- a/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java +++ b/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java @@ -222,7 +222,7 @@ public class StandardPlugin extends Plugin { } else { param = param.multiply(new NaiveNumber(2).promoteTo(param.getClass())); powersOf2--; - if (param.subtract(NaiveNumber.ONE.promoteTo(param.getClass())).signum() != 1) { + if (param.subtract(NaiveNumber.ONE.promoteTo(param.getClass())).signum() != -1) { break; //No infinite loop for you. }