GNU Scientific Library - Bugs: bug #31854, A divide by zero in the...
You are not allowed to post comments on this tracker with your current authentication level.
bug #31854: A divide by zero in the gsl_ran_gamma_knuth()
Submitter: | Myoung-serp. Shin. <relent95> | ||
Submitted: | Sun 12 Dec 2010 04:47:09 PM UTC | ||
Category: | Runtime error | Severity: | 3 - Normal |
Operating System: | Status: | Fixed | |
Assigned to: | None | Open/Closed: | Closed |
Release: | 1.14 |
Wed 15 Dec 2010 08:37:04 PM UTC, comment #2: |
-Deleted Account- <bjg> |
Mon 13 Dec 2010 07:54:17 PM UTC, comment #1: Thanks for the bug report. I guess we should just return 0 immediately from gamma_frac when a=0.
|
-Deleted Account- <bjg> |
Sun 12 Dec 2010 04:47:09 PM UTC, original submission:
The following lines of the randist/gamma.c calls gamma_frac(r, 0) if a is an integer.
|
Myoung-serp. Shin. <relent95> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Follow 3 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2010-12-15 | bjg | Status | Confirmed | Fixed | |
Open/Closed | Open | Closed | |||
2010-12-13 | bjg | Status | None | Confirmed |
Powered by Savane 3.13-02a9.
Corresponding source code
This is now fixed in r4706. Thanks for the bug report!
=== modified file 'randist/gamma.c'
--- randist/gamma.c 2008-11-30 09:00:46 +0000
+++ randist/gamma.c 2010-12-14 21:53:37 +0000
@@ -120,6 +120,11 @@
on page 551. */
double p, q, x, u, v;
+
+ if (a == 0) {
+ return 0;
+ }
+
p = M_E / (a + M_E);
do
{