~ubuntu-branches/ubuntu/utopic/python-scipy/utopic-proposed

« back to all changes in this revision

Viewing changes to scipy/special/cephes/kolmogorov.c

  • Committer: Package Import Robot
  • Author(s): Varun Hiremath
  • Date: 2012-04-20 02:37:28 UTC
  • Revision ID: package-import@ubuntu.com-20120420023728-c7164ileiq6i4og3
Tags: 0.10.1+dfsg1-2
* debian/control:
  - Recommends: python-imaging (Closes: #648036)
  - Recommends: python-dev (Closes: #651760)
* debian/patches:
  - Add kolmogorov.diff, thanks to Yaroslav Halchenko (Closes: #653948)
  - Add kde.diff (Closes: #648034)

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
  int v, nn;
36
36
  double evn, omevn, p, t, c, lgamnp1;
37
37
 
38
 
  if (n <= 0 || e < 0.0 || e > 1.0)
 
38
  if (!(n > 0 && e >= 0.0 && e <= 1.0))
39
39
    return (NPY_NAN);
40
40
  if (e == 0.0) return 1.0;
41
41
  nn = (int) (floor ((double) n * (1.0 - e)));
86
86
{
87
87
  double p, t, r, sign, x;
88
88
 
89
 
  if ( y < 1.1e-16 ) 
 
89
  if ( y < 1.1e-16 )
90
90
    return 1.0;
91
91
  x = -2.0 * y * y;
92
92
  sign = 1.0;
141
141
          mtherr ("smirnovi", OVERFLOW);
142
142
          return 0.0;
143
143
        }
144
 
      if (++iterations > MAXITER) 
 
144
      if (++iterations > MAXITER)
145
145
        {
146
146
          mtherr ("smirnovi", TOOMANY);
147
 
          return (e);          
 
147
          return (e);
148
148
        }
149
149
    }
150
150
  while (fabs (t / e) > 1e-10);
185
185
          return 0.0;
186
186
        }
187
187
      y = y + t;
188
 
      if (++iterations > MAXITER) 
 
188
      if (++iterations > MAXITER)
189
189
        {
190
190
          mtherr ("kolmogi", TOOMANY);
191
 
          return (y);          
192
 
        }      
 
191
          return (y);
 
192
        }
193
193
    }
194
194
  while (fabs (t / y) > 1.0e-10);
195
195
  return (y);