Skip to content

BUG: Invalid corner cases (resulting in nan+nanj) in complex multiplication #30805

@ikrommyd

Description

@ikrommyd

Describe the issue:

Similar to #26560 but for complex multiplication
See also CPython's issue: python/cpython#120287

Reproduce the code example:

>>> import numpy as np
>>> complex(1e100, 1) * complex(np.nan, np.inf)
(-inf+infj)
>>> np.complex128(1e100, 1) * np.complex128(np.nan, np.inf)
np.complex128(nan+nanj)

Python and NumPy Versions:

2.5.0.dev0+git20260205.0d79864
3.14.2+ (heads/3.14:f68d634, Feb 2 2026, 20:11:55) [GCC 15.2.1 20251112]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions