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 9d03df850d3f6593235f85a26d4d0cec50b31071
Author: Alex Herbert <aherb...@apache.org>
AuthorDate: Tue Mar 25 14:10:37 2025 +0000

    Sonar fix: correct float division
---
 .../test/java/org/apache/commons/rng/core/util/RandomStreamsTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/RandomStreamsTest.java
 
b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/RandomStreamsTest.java
index c65ccbe8..d45ec10b 100644
--- 
a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/RandomStreamsTest.java
+++ 
b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/RandomStreamsTest.java
@@ -161,7 +161,7 @@ class RandomStreamsTest {
         // Histogram the distribution for each unique 4-bit character
         final int m = (1 << CHAR_BITS) - 1;
         // Number of remaining characters
-        final int n = (int) Math.ceil((Long.SIZE - CHAR_BITS) / CHAR_BITS);
+        final int n = (int) Math.ceil((double) (Long.SIZE - CHAR_BITS) / 
CHAR_BITS);
         final int[][] h = new int[m + 1][m + 1];
         final int samples = 1 << 16;
         for (int i = 0; i < samples; i++) {

Reply via email to