[Python-Dev] math.hypot, complex.__abs__, and documentation

Mark Dickinson dickinsm at gmail.com
Tue Feb 16 23:14:53 CET 2010


On Tue, Feb 16, 2010 at 9:19 PM, David DiCato <ddicato at microsoft.com> wrote:
> I have a minor concern about certain corner cases with math.hypot and
> complex.__abs__, namely when one component is infinite and one is not a
> number.

<examples snipped>

> as well, and FWIW, I personally agree with this convention. However, the
> math module’s documentation for both 2.6 and 3.1 states, “All functions
> return a quiet NaN if at least one of the args is NaN.”

Yes;  this is a doc bug.  Please could you open an issue on
http://bugs.python.org
?

> math.pow(1.0, nan) is another such exception to the rule. Perhaps the
> documentation should be updated to reflect this.

Yes, it should.  Thanks!

Mark


More information about the Python-Dev mailing list