Skip to content

Commit 47e8502

Browse files
committed
Sonarqube: Make sure "den" can't be zero before doing this division.
1 parent 33675ed commit 47e8502

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/MathModuleBuiltins.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,7 @@ static double lanczos_sum(double x) {
22302230
den = den / x + LANCZOS_DEN_COEFFS[i];
22312231
}
22322232
}
2233+
assert den > 0.0 : "den cannot be zero, because LANCZOS_DEN_COEFFS are added";
22332234
return num / den;
22342235
}
22352236

0 commit comments

Comments
 (0)