Skip to content

sqrt returns wrong result for inf + j #2241

@antonwolfy

Description

@antonwolfy

The following example breaks Python array API:

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

a = dpt.asarray(complex(np.inf, 1))

dpt.sqrt(a)
# Out: usm_ndarray(inf+0.j)

but the spec states:

If a is +infinity and b is a positive (i.e., greater than 0) finite number, the result is +0 + infinity j.

Metadata

Metadata

Assignees

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