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: data-apis#814 Ref: numpy/numpy#24976 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy