Skip to content

Commit 56fb2fb

Browse files
authored
Merge pull request data-apis#99 from rgommers/result-type
Add a `result_type` function to the API specification
2 parents 09ab917 + 7e2483f commit 56fb2fb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Diff for: spec/API_specification/utility_functions.md

+24
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,27 @@ Tests whether any input array element evaluates to `True` along a specified axis
6464
- **out**: _<array>_
6565

6666
- if a logical OR reduction was performed over the entire array, the returned array must be a zero-dimensional array containing the test result; otherwise, the returned array must be a non-zero-dimensional array containing the test results. The returned array must have a data type of `bool`.
67+
68+
69+
(function-result_type)=
70+
### result_type(*arrays_and_dtypes)
71+
72+
Returns the dtype that results from applying the type promotion rules
73+
(see {ref}`type-promotion`) to the arguments.
74+
75+
```{note}
76+
If mixed dtypes (e.g. integer and floating-point) are used, the output of
77+
`result_type` will be implementation-specific.
78+
```
79+
80+
#### Parameters
81+
82+
- **arrays_and_dtypes**: _Sequence\[Union\[<array>, <dtype>\]\];_
83+
84+
- input arrays and dtypes.
85+
86+
#### Returns
87+
88+
- **out**: _<dtype>_
89+
90+
- the dtype resulting from an operation involving the input arrays and dtypes.

0 commit comments

Comments
 (0)