Skip to content

Commit f73baff

Browse files
asmeurerkgryte
andauthored
docs: clarify that clip behavior is undefined when min or max is outside the bounds of x
PR-URL: #814 Ref: numpy/numpy#24976 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]>
1 parent c7476ba commit f73baff

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/array_api_stubs/_2023_12/elementwise_functions.py

+1
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ def clip(
805805
806806
- If both ``min`` and ``max`` are ``None``, the elements of the returned array must equal the respective elements in ``x``.
807807
- If a broadcasted element in ``min`` is greater than a corresponding broadcasted element in ``max``, behavior is unspecified and thus implementation-dependent.
808+
- If ``x`` has an integral data type and a broadcasted element in ``min`` or ``max`` is outside the bounds of the data type of ``x``, behavior is unspecified and thus implementation-dependent.
808809
- If ``x`` and either ``min`` or ``max`` have different data type kinds (e.g., integer versus floating-point), behavior is unspecified and thus implementation-dependent.
809810
810811
**Special cases**

src/array_api_stubs/_draft/elementwise_functions.py

+1
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ def clip(
838838
839839
- If both ``min`` and ``max`` are ``None``, the elements of the returned array must equal the respective elements in ``x``.
840840
- If a broadcasted element in ``min`` is greater than a corresponding broadcasted element in ``max``, behavior is unspecified and thus implementation-dependent.
841+
- If ``x`` has an integral data type and a broadcasted element in ``min`` or ``max`` is outside the bounds of the data type of ``x``, behavior is unspecified and thus implementation-dependent.
841842
- If ``x`` and either ``min`` or ``max`` have different data type kinds (e.g., integer versus floating-point), behavior is unspecified and thus implementation-dependent.
842843
843844
**Special cases**

0 commit comments

Comments
 (0)