Skip to content

Commit 11a3d2c

Browse files
authored
Update guidance for unsigned integer data types (#340)
1 parent 3e47648 commit 11a3d2c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spec/API_specification/statistical_functions.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ For an input array `x`, let `N` equal the number of elements over which to compu
134134
- data type of the returned array. If `None`,
135135

136136
- if the default data type corresponding to the data type "kind" (integer or floating-point) of `x` has a smaller range of values than the data type of `x` (e.g., `x` has data type `int64` and the default data type is `int32`, or `x` has data type `uint64` and the default data type is `int64`), the returned array must have the same data type as `x`.
137-
- otherwise, the returned array must have the default data type corresponding to the data type "kind" (integer or floating-point) of `x`.
137+
- if `x` has a floating-point data type, the returned array must have the default floating-point data type.
138+
- if `x` has a signed integer data type (e.g., `int16`), the returned array must have the default integer data type.
139+
- if `x` has an unsigned integer data type (e.g., `uint16`), the returned array must have an unsigned integer data type having the same number of bits as the default integer data type (e.g., if the default integer data type is `int32`, the returned array must have a `uint32` data type).
138140

139141
If the data type (either specified or resolved) differs from the data type of `x`, the input array should be cast to the specified data type before computing the product. Default: `None`.
140142

@@ -217,7 +219,9 @@ For an input array `x`, let `N` equal the number of elements over which to compu
217219
- data type of the returned array. If `None`,
218220
219221
- if the default data type corresponding to the data type "kind" (integer or floating-point) of `x` has a smaller range of values than the data type of `x` (e.g., `x` has data type `int64` and the default data type is `int32`, or `x` has data type `uint64` and the default data type is `int64`), the returned array must have the same data type as `x`.
220-
- otherwise, the returned array must have the default data type corresponding to the data type "kind" (integer or floating-point) of `x`.
222+
- if `x` has a floating-point data type, the returned array must have the default floating-point data type.
223+
- if `x` has a signed integer data type (e.g., `int16`), the returned array must have the default integer data type.
224+
- if `x` has an unsigned integer data type (e.g., `uint16`), the returned array must have an unsigned integer data type having the same number of bits as the default integer data type (e.g., if the default integer data type is `int32`, the returned array must have a `uint32` data type).
221225
222226
If the data type (either specified or resolved) differs from the data type of `x`, the input array should be cast to the specified data type before computing the sum. Default: `None`.
223227

0 commit comments

Comments
 (0)