Skip to content

Commit 5efe64c

Browse files
committed
Prohibit div functions return int arrays
Also fixes related note wording for `min()` and `max()`
1 parent d1d072b commit 5efe64c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

spec/API_specification/array_object.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,9 @@ Element-wise results must equal the results returned by the equivalent element-w
12501250
Evaluates `self_i / other_i` for each element of an array instance with the respective element of the array `other`.
12511251

12521252
```{note}
1253-
If one or both of `self` and `other` have integer data types, the result is unspecified and thus implementation-dependent. This is because type promotion between data type “kinds” (i.e. integer versus floating-point) is unspecified.
1253+
If one or both of `self` and `other` have integer data types, the result is implementation-dependent. This is because type promotion between data type “kinds” (i.e. integer versus floating-point) is unspecified.
1254+
1255+
Specification-compliant libraries may choose to raise an error or return an array containing the element-wise results. If an array is returned, it must have a floating-point data type.
12541256
```
12551257

12561258
#### Special Cases

spec/API_specification/elementwise_functions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,9 @@ For floating-point operands,
529529
Calculates the division for each element `x1_i` of the input array `x1` with the respective element `x2_i` of the input array `x2`.
530530

531531
```{note}
532-
If one or both of the input arrays have integer data types, the result is unspecified and thus implementation-dependent. This is because type promotion between data type “kinds” (i.e. integer versus floating-point) is unspecified.
532+
If one or both of the input arrays have integer data types, the result is implementation-dependent. This is because type promotion between data type “kinds” (i.e. integer versus floating-point) is unspecified.
533+
534+
Specification-compliant libraries may choose to raise an error or return an array containing the element-wise results. If an array is returned, it must have a floating-point data type.
533535
```
534536

535537
#### Special Cases

spec/API_specification/statistical_functions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ A conforming implementation of the array API standard must provide and support t
2121
Calculates the maximum value of the input array `x`.
2222

2323
```{note}
24-
When the number of elements over which to compute the maximum value is zero, the maximum value is implementation-defined. Specification-compliant libraries may choose to error, return a sentinel value (e.g., if `x` is a floating-point input array, return `NaN`), or return the minimum possible value for the input array `x` data type (e.g., if `x` is a floating-point array, return `-infinity`).
24+
When the number of elements over which to compute the maximum value is zero, the maximum value is implementation-defined. Specification-compliant libraries may choose to raise an error, return a sentinel value (e.g., if `x` is a floating-point input array, return `NaN`), or return the minimum possible value for the input array `x` data type (e.g., if `x` is a floating-point array, return `-infinity`).
2525
```
2626

2727
#### Special Cases
@@ -92,7 +92,7 @@ Let `N` equal the number of elements over which to compute the arithmetic mean.
9292
Calculates the minimum value of the input array `x`.
9393
9494
```{note}
95-
When the number of elements over which to compute the minimum value is zero, the minimum value is implementation-defined. Specification-compliant libraries may choose to error, return a sentinel value (e.g., if `x` is a floating-point input array, return `NaN`), or return the maximum possible value for the input array `x` data type (e.g., if `x` is a floating-point array, return `+infinity`).
95+
When the number of elements over which to compute the minimum value is zero, the minimum value is implementation-defined. Specification-compliant libraries may choose to raise an error, return a sentinel value (e.g., if `x` is a floating-point input array, return `NaN`), or return the maximum possible value for the input array `x` data type (e.g., if `x` is a floating-point array, return `+infinity`).
9696
```
9797

9898
#### Special Cases

0 commit comments

Comments
 (0)