You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- if the default data type corresponding to the data type "kind" (integer, real-valued floating-point, or complex 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``.
721
-
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
722
-
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
723
-
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
724
-
- 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).
721
+
- if the default data type corresponding to the data type "kind" of ``x`` has the same or a larger range of values than the data type of ``x``,
722
+
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
723
+
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
724
+
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
725
+
- 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).
725
726
726
727
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``.
Copy file name to clipboardExpand all lines: src/array_api_stubs/_draft/statistical_functions.py
+10-8Lines changed: 10 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -143,10 +143,11 @@ def prod(
143
143
data type of the returned array. If ``None``,
144
144
145
145
- if the default data type corresponding to the data type "kind" (integer, real-valued floating-point, or complex 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``.
146
-
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
147
-
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
148
-
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
149
-
- 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).
146
+
- if the default data type corresponding to the data type "kind" of ``x`` has the same or a larger range of values than the data type of ``x``,
147
+
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
148
+
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
149
+
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
150
+
- 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).
150
151
151
152
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``.
152
153
@@ -240,10 +241,11 @@ def sum(
240
241
data type of the returned array. If ``None``,
241
242
242
243
- if the default data type corresponding to the data type "kind" (integer, real-valued floating-point, or complex 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``.
243
-
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
244
-
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
245
-
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
246
-
- 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).
244
+
- if the default data type corresponding to the data type "kind" of ``x`` has the same or a larger range of values than the data type of ``x``,
245
+
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
246
+
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
247
+
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
248
+
- 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).
247
249
248
250
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``.
0 commit comments