"""
if p <= 0.0 or p >= 1.0:
raise StatisticsError('p must be in the range 0.0 < p < 1.0')
- if self._sigma <= 0.0:
- raise StatisticsError('cdf() not defined when sigma at or below zero')
return _normal_dist_inv_cdf(p, self._mu, self._sigma)
def quantiles(self, n=4):
iq.inv_cdf(1.0) # p is one
with self.assertRaises(self.module.StatisticsError):
iq.inv_cdf(1.1) # p over one
- with self.assertRaises(self.module.StatisticsError):
- iq = NormalDist(100, 0) # sigma is zero
- iq.inv_cdf(0.5)
+
+ # Supported case:
+ iq = NormalDist(100, 0) # sigma is zero
+ self.assertEqual(iq.inv_cdf(0.5), 100)
# Special values
self.assertTrue(math.isnan(Z.inv_cdf(float('NaN'))))
/*[clinic end generated code: output=02fd19ddaab36602 input=24715a74be15296a]*/
{
double q, num, den, r, x;
- if (p <= 0.0 || p >= 1.0 || sigma <= 0.0) {
+ if (p <= 0.0 || p >= 1.0) {
goto error;
}