diff --git a/spec/API_specification/elementwise_functions.md b/spec/API_specification/elementwise_functions.md index 2569a0f6e..2238d55ac 100644 --- a/spec/API_specification/elementwise_functions.md +++ b/spec/API_specification/elementwise_functions.md @@ -394,6 +394,98 @@ Calculates an implementation-dependent approximation to the natural (base `e`) l - an array containing the evaluated natural logarithm for each element in `x`. +### # logical_and(x1, x2, /, *, out=None) + +Computes the logical AND for each element `x1_i` of the input array `x1` with the respective element `x2_i` of the input array `x2`. Zeros should be considered the equivalent of `False`, while non-zeros should be considered the equivalent of `True`. + +#### Parameters + +- **x1**: _<array>_ + + - first input array. + +- **x2**: _<array>_ + + - second input array. Must be compatible with `x1` (see :ref:`broadcasting`). + +- **out**: _Optional\[ <array> ]_ + + - output array. If provided, the output array must be compatible with the provided input arrays (see :ref:`broadcasting`). If not provided or is `None`, an uninitialized return array, whose underlying data type is `bool`, must be created and then filled with the result of each element-wise computation. Default: `None`. + +#### Returns + +- **out**: _<array>_ + + - an array containing the element-wise results. + +### # logical_not(x, /, *, out=None) + +Computes the logical NOT for each element `x_i` of the input array `x`. Zeros should be considered the equivalent of `False`, while non-zeros should be considered the equivalent of `True`. + +#### Parameters + +- **x**: _<array>_ + + - input array. + +- **out**: _Optional\[ <array> ]_ + + - output array. If provided, the output array must be compatible with the provided input array `x` (see :ref:`broadcasting`). If not provided or is `None`, an uninitialized return array, whose underlying data type is `bool`, must be created and then filled with the result of each element-wise computation. Default: `None`. + +#### Returns + +- **out**: _<array>_ + + - an array containing the element-wise results. + +### # logical_or(x1, x2, /, *, out=None) + +Computes the logical OR for each element `x1_i` of the input array `x1` with the respective element `x2_i` of the input array `x2`. Zeros should be considered the equivalent of `False`, while non-zeros should be considered the equivalent of `True`. + +#### Parameters + +- **x1**: _<array>_ + + - first input array. + +- **x2**: _<array>_ + + - second input array. Must be compatible with `x1` (see :ref:`broadcasting`). + +- **out**: _Optional\[ <array> ]_ + + - output array. If provided, the output array must be compatible with the provided input arrays (see :ref:`broadcasting`). If not provided or is `None`, an uninitialized return array, whose underlying data type is `bool`, must be created and then filled with the result of each element-wise computation. Default: `None`. + +#### Returns + +- **out**: _<array>_ + + - an array containing the element-wise results. + +### # logical_xor(x1, x2, /, *, out=None) + +Computes the logical XOR for each element `x1_i` of the input array `x1` with the respective element `x2_i` of the input array `x2`. Zeros must should be considered the equivalent of `False`, while non-zeros must should be considered the equivalent of `True`. + +#### Parameters + +- **x1**: _<array>_ + + - first input array. + +- **x2**: _<array>_ + + - second input array. Must be compatible with `x1` (see :ref:`broadcasting`). + +- **out**: _Optional\[ <array> ]_ + + - output array. If provided, the output array must be compatible with the provided input arrays (see :ref:`broadcasting`). If not provided or is `None`, an uninitialized return array, whose underlying data type is `bool`, must be created and then filled with the result of each element-wise computation. Default: `None`. + +#### Returns + +- **out**: _<array>_ + + - an array containing the element-wise results. + ### # multiply(x1, x2, /, *, out=None) Calculates the product for each element `x1_i` of the input array `x1` with the respective element `x2_i` of the input array `x2`.