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``.
748
-
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
749
-
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
750
-
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
751
-
- 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).
748
+
- 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``,
749
+
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
750
+
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
751
+
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
752
+
- 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).
752
753
753
754
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-8
Original file line number
Diff line number
Diff line change
@@ -146,10 +146,11 @@ def prod(
146
146
data type of the returned array. If ``None``,
147
147
148
148
- 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``.
149
-
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
150
-
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
151
-
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
152
-
- 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).
149
+
- 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``,
150
+
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
151
+
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
152
+
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
153
+
- 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).
153
154
154
155
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``.
155
156
@@ -243,10 +244,11 @@ def sum(
243
244
data type of the returned array. If ``None``,
244
245
245
246
- 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``.
246
-
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
247
-
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
248
-
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
249
-
- 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
+
- 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``,
248
+
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
249
+
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
250
+
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
251
+
- 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).
250
252
251
253
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