array-api icon indicating copy to clipboard operation
array-api copied to clipboard

feat!: allow clip to have int min or max when x is floating-point

Open asmeurer opened this issue 1 year ago • 2 comments

This is for consistency with operators, which allow combining an int with an array that has a floating-point data type.

See the discussion at #807.

I also mentioned this at the meeting last week.

asmeurer avatar Jun 04 '24 18:06 asmeurer

I also made it clearer that if all three arguments are arrays then there is a three-way broadcast.

asmeurer avatar Jun 04 '24 18:06 asmeurer

Note that if we decide to fix #807 more generally we may want to just remove the specific language for promotion behavior for Python scalars from clip and fold it into the type promotion page (which would also imply this change).

asmeurer avatar Jun 04 '24 18:06 asmeurer

I've opened another PR which should supersede this one (see https://github.com/data-apis/array-api/pull/896) and includes the 3-way merge edits (including backport) which was included here.

kgryte avatar Feb 06 '25 10:02 kgryte