Skip to content

Commit a24ac53

Browse files
authored
Add logical specifications (#26)
1 parent 646f108 commit a24ac53

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

spec/API_specification/elementwise_functions.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,98 @@ Calculates an implementation-dependent approximation to the natural (base `e`) l
394394

395395
- an array containing the evaluated natural logarithm for each element in `x`.
396396

397+
### <a name="logical_and" href="#logical_and">#</a> logical_and(x1, x2, /, *, out=None)
398+
399+
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`.
400+
401+
#### Parameters
402+
403+
- **x1**: _&lt;array&gt;_
404+
405+
- first input array.
406+
407+
- **x2**: _&lt;array&gt;_
408+
409+
- second input array. Must be compatible with `x1` (see :ref:`broadcasting`).
410+
411+
- **out**: _Optional\[ &lt;array&gt; ]_
412+
413+
- 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`.
414+
415+
#### Returns
416+
417+
- **out**: _&lt;array&gt;_
418+
419+
- an array containing the element-wise results.
420+
421+
### <a name="logical_not" href="#logical_not">#</a> logical_not(x, /, *, out=None)
422+
423+
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`.
424+
425+
#### Parameters
426+
427+
- **x**: _&lt;array&gt;_
428+
429+
- input array.
430+
431+
- **out**: _Optional\[ &lt;array&gt; ]_
432+
433+
- 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`.
434+
435+
#### Returns
436+
437+
- **out**: _&lt;array&gt;_
438+
439+
- an array containing the element-wise results.
440+
441+
### <a name="logical_or" href="#logical_or">#</a> logical_or(x1, x2, /, *, out=None)
442+
443+
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`.
444+
445+
#### Parameters
446+
447+
- **x1**: _&lt;array&gt;_
448+
449+
- first input array.
450+
451+
- **x2**: _&lt;array&gt;_
452+
453+
- second input array. Must be compatible with `x1` (see :ref:`broadcasting`).
454+
455+
- **out**: _Optional\[ &lt;array&gt; ]_
456+
457+
- 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`.
458+
459+
#### Returns
460+
461+
- **out**: _&lt;array&gt;_
462+
463+
- an array containing the element-wise results.
464+
465+
### <a name="logical_xor" href="#logical_xor">#</a> logical_xor(x1, x2, /, *, out=None)
466+
467+
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`.
468+
469+
#### Parameters
470+
471+
- **x1**: _&lt;array&gt;_
472+
473+
- first input array.
474+
475+
- **x2**: _&lt;array&gt;_
476+
477+
- second input array. Must be compatible with `x1` (see :ref:`broadcasting`).
478+
479+
- **out**: _Optional\[ &lt;array&gt; ]_
480+
481+
- 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`.
482+
483+
#### Returns
484+
485+
- **out**: _&lt;array&gt;_
486+
487+
- an array containing the element-wise results.
488+
397489
### <a name="multiply" href="#multiply">#</a> multiply(x1, x2, /, *, out=None)
398490

399491
Calculates the product for each element `x1_i` of the input array `x1` with the respective element `x2_i` of the input array `x2`.

0 commit comments

Comments
 (0)