Skip to content

Order of signed zeros when computing the minimum and maximum #707

Description

@kgryte

Currently, the specifications for computing the min and max do not state what should happen in the event of signed zeros. E.g.,

> x = xp.asarray([0.0, -0.0])
> xp.min(x)
???

NumPy returns -0.0 for the above, which is likely the desired behavior.

In [1]: np.min([0.0, -0.0])
Out[1]: -0.0

In [2]: np.min([-0.0, 0.0] )
Out[2]: -0.0

The ordering of signed zeros does not appear to have been discussed in #10 or in #17 which were opened during initial development of the Array API Standard.

This issue has relevance for #667, as, if signed zeros are ordered when computing the minimum and maximum, xp.where is not a simple replacement for element-wise minimum and maximum APIs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions