Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

np.clip: change in precedence between minimum and maximum when maximum < minimum #15061

Copy link
Copy link
Closed
@flexatone

Description

@flexatone
Issue body actions

Greetings!

First, thanks to the NumPy community for your efforts.

Second, In NumPy 1.16.5 I observe the following:

>>> import numpy as np
>>> np.clip(2, 3, 0)
3

In NumPy 1.17.4, I get a different result:

>>> import numpy as np
>>> np.clip(2, 3, 0)
0

I see that the difference has to do with which constraint gets precedence. Was this an intentional change in precedence then?

Reproducing code example:

import numpy as np
assert np.clip(2, 3, 0), 3

Numpy/Python version information:

>>> import sys, numpy; print(numpy.__version__, sys.version)
1.17.4 3.7.4 (default, Dec  3 2019, 11:37:16) 
[GCC 5.4.0 20160609]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.