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-numbers.git

commit 9de1d4816e906e647e22fe12d62f659ddf474506
Author: aherbert <[email protected]>
AuthorDate: Wed May 4 17:55:04 2022 +0100

    Sonar fix: Extract nested ternary
---
 .../src/main/java/org/apache/commons/numbers/gamma/BoostGamma.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/BoostGamma.java
 
b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/BoostGamma.java
index 07747fe3..9356852d 100644
--- 
a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/BoostGamma.java
+++ 
b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/BoostGamma.java
@@ -1153,7 +1153,10 @@ final class BoostGamma {
         // Now special cases:
         //
         if (x == 0) {
-            return (a > 1) ? 0 : (a == 1) ? 1 : Double.POSITIVE_INFINITY;
+            if (a > 1) {
+                return 0;
+            }
+            return (a == 1) ? 1 : Double.POSITIVE_INFINITY;
         }
         //
         // Normal case:

Reply via email to