math.sumprod() missing one case for combined int/float inputs.
オープン
@rhettinger がすでに取り組んでいます。
2025年9月17日 から。
extension-modules
type-bug
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
The sumprod function has high precision paths for int/int, int/float, and float/float inputs. However it missed a case when an int/int pair follows another pair that contained a float. In other words, it assumes that once a float is encountered, that subsequent inputs won't contain a pair of ints.
>>> import math
>>> data = [-0.01, 1, -1, 0.01]
>>> math.sumprod(data, [1, 1, 1, 1])
-8.673617379884035e-18
>>> math.sumprod(data, [1.0, 1.0, 1.0, 1.0])
0.0
CPython versions tested on:
3.13, 3.15, 3.14
Operating systems tested on:
macOS
Linked PRs
- gh-139075
- gh-139085
- gh-139086
- gh-139092
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。