UNPKG

1.02 kBMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function or
4
5Logical `or`. Test if at least one value is defined with a nonzero/nonempty value.
6For matrices, the function is evaluated element wise.
7
8
9## Syntax
10
11```js
12math.or(x, y)
13```
14
15### Parameters
16
17Parameter | Type | Description
18--------- | ---- | -----------
19`x` | number &#124; BigNumber &#124; Complex &#124; Unit &#124; Array &#124; Matrix | First value to check
20`y` | number &#124; BigNumber &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Second value to check
21
22### Returns
23
24Type | Description
25---- | -----------
26boolean &#124; Array &#124; Matrix | Returns true when one of the inputs is defined with a nonzero/nonempty value.
27
28
29## Examples
30
31```js
32math.or(2, 4) // returns true
33
34a = [2, 5, 0]
35b = [0, 22, 0]
36c = 0
37
38math.or(a, b) // returns [true, true, false]
39math.or(b, c) // returns [false, true, false]
40```
41
42
43## See also
44
45[and](and.md),
46[not](not.md),
47[xor](xor.md)