Skip to content

Commit

Permalink
REF: add check that updating doesn't stop to prevent endless loops
Browse files Browse the repository at this point in the history
  • Loading branch information
josef-pkt committed Jan 3, 2013
1 parent 69e0bf2 commit 123a7da
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scipy/stats/distributions.py
Expand Up @@ -5392,10 +5392,16 @@ def _drv2_ppfsingle(self, q, *args): # Use basic bisection algorithm
c = int((a+b)/2.0)
qc = self._cdf(c, *args)
if (qc < q):
a = c
if a != c:
a = c
else:
raise RuntimeError('updating stopped, endless loop')
qa = qc
elif (qc > q):
b = c
if b != c:
b = c
else:
raise RuntimeError('updating stopped, endless loop')
qb = qc
else:
return c
Expand Down

0 comments on commit 123a7da

Please sign in to comment.