◐ Shell
clean mode source ↗

gh-117999: fixed small nonnegative integer powers of complex numbers by skirpichev · Pull Request #118000 · python/cpython

@bedevere-app Bot mentioned this pull request

Apr 17, 2024

@skirpichev 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

Apr 24, 2024

@skirpichev 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

May 12, 2024
…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)

picnixz

skirpichev

skirpichev

skirpichev

skirpichev

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>