result_type¶
- result_type(*arrays_and_dtypes: array | int | float | complex | bool | dtype) dtype ¶
Returns the dtype that results from applying type promotion rules (see Type Promotion Rules) to the arguments.
- Parameters:
arrays_and_dtypes (Union[array, int, float, complex, bool, dtype]) – an arbitrary number of input arrays, scalars, and/or dtypes.
- Returns:
out (dtype) – the dtype resulting from an operation involving the input arrays, scalars, and/or dtypes.
Notes
At least one argument must be an array or a dtype.
If provided array and/or dtype arguments having mixed data type kinds (e.g., integer and floating-point), the returned dtype is unspecified and thus implementation-dependent.
If at least one argument is an array, the function must determine the resulting dtype according to the type promotion graph of the array device which is shared among all array arguments. As not all devices can support all data types, full support for type promotion rules (see Type Promotion Rules) may not be possible. Accordingly, the returned dtype may differ from that determined from the complete type promotion graph defined in this specification (see Type Promotion Rules).
If two or more arguments are arrays belonging to different devices, behavior is unspecified and thus implementation-dependent. Conforming implementations may choose to ignore device attributes, raise an exception, or some other behavior.