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