This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-rng.git
commit 2232aabc3ae634ca9640b709d605a1c95a58d05a Author: Alex Herbert <aherb...@apache.org> AuthorDate: Fri Aug 13 13:59:26 2021 +0100 Update the method to make a boolean There is no requirement to shift the sign bit as the number can be directly compared to zero. --- .../src/main/java/org/apache/commons/rng/core/util/NumberFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commons-rng-core/src/main/java/org/apache/commons/rng/core/util/NumberFactory.java b/commons-rng-core/src/main/java/org/apache/commons/rng/core/util/NumberFactory.java index ddc46f7..59ee1b7 100644 --- a/commons-rng-core/src/main/java/org/apache/commons/rng/core/util/NumberFactory.java +++ b/commons-rng-core/src/main/java/org/apache/commons/rng/core/util/NumberFactory.java @@ -60,7 +60,7 @@ public final class NumberFactory { */ @Deprecated public static boolean makeBoolean(int v) { - return (v >>> 31) != 0; + return v < 0; } /** @@ -74,7 +74,7 @@ public final class NumberFactory { */ @Deprecated public static boolean makeBoolean(long v) { - return (v >>> 63) != 0; + return v < 0; } /**