Skip to content

acosh returns wrong result for 0+nanj #2240

@antonwolfy

Description

@antonwolfy

The following example does not match NumPy:

import dpctl, dpctl.tensor as dpt, numpy as np

dpctl.__version__
# Out: '0.22.0dev0+114.g0797836be2'

a = dpt.asarray([complex(+0, np.nan)])
dpt.acosh(a)
# Out: usm_ndarray([nan+nanj])

a = np.asarray([complex(+0, np.nan)])
np.acosh(a)
# Out: array([nan+1.57079633j])

and based on Python array API spec:

If a is +0 and b is NaN, the result is NaN ± πj/2 (sign of imaginary component is unspecified).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions