gh-117999: fixed small nonnegative integer powers of complex numbers by skirpichev · Pull Request #118000 · python/cpython
Bot
mentioned this pull request
skirpichev
changed the title
gh-117999: fixed invalid small integer powers of real±0j
gh-117999: fixed small nonnegative integer powers of complex numbers with special components
skirpichev
changed the title
gh-117999: fixed small nonnegative integer powers of complex numbers with special components
gh-117999: fixed small nonnegative integer powers of complex numbers
…mbers
Before, handling of numbers with special values in components
(infinities, nans, signed zero) was invalid. Simple example:
>>> z = complex(1, -0.0)
>>> z*z
(1-0j)
>>> z**2
(1+0j)
Now:
>>> z**2
(1-0j)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters