Repository: commons-math Updated Branches: refs/heads/master e779883b2 -> a71c820ba
use short-circuiting ops Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/a71c820b Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/a71c820b Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/a71c820b Branch: refs/heads/master Commit: a71c820baeb91025eaa7f07b172a39500c6f5692 Parents: e779883 Author: Dave Brosius <dbros...@mebigfatguy.com> Authored: Tue Dec 29 14:26:06 2015 -0500 Committer: Dave Brosius <dbros...@mebigfatguy.com> Committed: Tue Dec 29 14:26:06 2015 -0500 ---------------------------------------------------------------------- src/main/java/org/apache/commons/math4/util/ArithmeticUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/a71c820b/src/main/java/org/apache/commons/math4/util/ArithmeticUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/util/ArithmeticUtils.java b/src/main/java/org/apache/commons/math4/util/ArithmeticUtils.java index 4b54875..bab02d3 100644 --- a/src/main/java/org/apache/commons/math4/util/ArithmeticUtils.java +++ b/src/main/java/org/apache/commons/math4/util/ArithmeticUtils.java @@ -650,7 +650,7 @@ public final class ArithmeticUtils { */ private static long addAndCheck(long a, long b, Localizable pattern) throws MathArithmeticException { final long result = a + b; - if (!((a ^ b) < 0 | (a ^ result) >= 0)) { + if (!((a ^ b) < 0 || (a ^ result) >= 0)) { throw new MathArithmeticException(pattern, a, b); } return result;