From c0fe2361a17c3e6b5dc0030ce50667bb243735bb Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Thu, 4 Nov 2021 04:55:47 -0700 Subject: [PATCH] Add note concerning division by zero for integer dtypes --- spec/API_specification/array_object.md | 8 ++++++++ spec/API_specification/elementwise_functions.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/spec/API_specification/array_object.md b/spec/API_specification/array_object.md index 2f4fe7e99..42a86befe 100644 --- a/spec/API_specification/array_object.md +++ b/spec/API_specification/array_object.md @@ -608,6 +608,10 @@ Converts a zero-dimensional floating-point array to a Python `float` object. Evaluates `self_i // other_i` for each element of an array instance with the respective element of the array `other`. +```{note} +For input arrays which promote to an integer data type, the result of division by zero is unspecified and thus implementation-defined. +``` + #### Parameters - **self**: _<array>_ @@ -886,6 +890,10 @@ The `matmul` function must implement the same semantics as the built-in `@` oper Evaluates `self_i % other_i` for each element of an array instance with the respective element of the array `other`. +```{note} +For input arrays which promote to an integer data type, the result of division by zero is unspecified and thus implementation-defined. +``` + #### Parameters - **self**: _<array>_ diff --git a/spec/API_specification/elementwise_functions.md b/spec/API_specification/elementwise_functions.md index 35210d7b1..58cee33af 100644 --- a/spec/API_specification/elementwise_functions.md +++ b/spec/API_specification/elementwise_functions.md @@ -668,6 +668,10 @@ Rounds each element `x_i` of the input array `x` to the greatest (i.e., closest Rounds the result of dividing each element `x1_i` of the input array `x1` by the respective element `x2_i` of the input array `x2` to the greatest (i.e., closest to `+infinity`) integer-value number that is not greater than the division result. +```{note} +For input arrays which promote to an integer data type, the result of division by zero is unspecified and thus implementation-defined. +``` + #### Parameters - **x1**: _<array>_ @@ -1213,6 +1217,10 @@ For floating-point operands, Returns the remainder of division for each element `x1_i` of the input array `x1` and the respective element `x2_i` of the input array `x2`. +```{note} +For input arrays which promote to an integer data type, the result of division by zero is unspecified and thus implementation-defined. +``` + #### Parameters - **x1**: _<array>_