[issue8986] math.erfc OverflowError

Mark Dickinson report at bugs.python.org
Sun Jun 13 11:34:31 CEST 2010

Mark Dickinson <dickinsm at gmail.com> added the comment:

Looking at the source, I think I know where this is coming from:  one of the terms in the expression for erfc(x) is exp(-x*x).  For abs(x) >= 27.284 or so, this underflows to zero.

So the likely cause is that whatever platform you're on is setting errno to ERANGE on underflow to 0;  that errno value later gets interpreted as representing an overflow.

And for x >= 30.0 a constant expression is used instead, so there's no OverflowError any more.

Okay:  solved in principle!


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list