[New-bugs-announce] [issue46828] math.prod can return integers (contradicts doc)

Neil Webber report at bugs.python.org
Tue Feb 22 14:04:33 EST 2022


New submission from Neil Webber <nw at neilwebber.com>:

The math module documentation says:

   Except when explicitly noted otherwise, all return values are floats.

But this code returns an integer:

   from math import prod; prod((1,2,3))

Doc should "explicitly note otherwise" here, I imagine. The issue being wanting to know that the result on all-integer input will be an exact (integer) value not a floating value.

----------
assignee: docs at python
components: Documentation
messages: 413741
nosy: docs at python, neilwebber
priority: normal
severity: normal
status: open
title: math.prod can return integers (contradicts doc)
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46828>
_______________________________________


More information about the New-bugs-announce mailing list