Skip to content

Commit f9f5d8b

Browse files
committed
docs: clarify type promotion behavior
1 parent 26bbc05 commit f9f5d8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/array_api_stubs/_draft/elementwise_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,11 +837,11 @@ def clip(
837837
-----
838838
839839
- This function is conceptually equivalent to ``maximum(minimum(x, max), min)`` when ``x``, ``min``, and ``max`` have the same data type.
840-
- For scalar ``min`` and/or ``max``, the scalar values must be converted to zero-dimensional arrays having the same data type as ``x`` prior to broadcasting.
841840
- If both ``min`` and ``max`` are ``None``, the elements of the returned array must equal the respective elements in ``x``.
842841
- If a broadcasted element in ``min`` is greater than a corresponding broadcasted element in ``max``, behavior is unspecified and thus implementation-dependent.
842+
- For scalar ``min`` and/or ``max``, the scalar values should follow type promotion rules (see :ref:`type-promotion`). 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
843843
- 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.
844-
- If ``x`` and either ``min`` or ``max`` have different data types and/or data type kinds (e.g., integer versus floating-point), behavior is unspecified and thus implementation-dependent.
844+
- If ``x`` and either ``min`` or ``max`` is an array having a different data type, behavior is unspecified and thus implementation-dependent.
845845
846846
**Special cases**
847847

0 commit comments

Comments
 (0)