1 |
|
2 |
|
3 | # Function bitOr
|
4 |
|
5 | Bitwise OR two values, `x | y`.
|
6 | For matrices, the function is evaluated element wise.
|
7 | For units, the function is evaluated on the lowest print base.
|
8 |
|
9 |
|
10 | ## Syntax
|
11 |
|
12 | ```js
|
13 | math.bitOr(x, y)
|
14 | ```
|
15 |
|
16 | ### Parameters
|
17 |
|
18 | Parameter | Type | Description
|
19 | --------- | ---- | -----------
|
20 | `x` | number | BigNumber | Array | Matrix | First value to or
|
21 | `y` | number | BigNumber | Array | Matrix | Second value to or
|
22 |
|
23 | ### Returns
|
24 |
|
25 | Type | Description
|
26 | ---- | -----------
|
27 | number | BigNumber | Array | Matrix | OR of `x` and `y`
|
28 |
|
29 |
|
30 | ## Examples
|
31 |
|
32 | ```js
|
33 | math.bitOr(1, 2) // returns number 3
|
34 |
|
35 | math.bitOr([1, 2, 3], 4) // returns Array [5, 6, 7]
|
36 | ```
|
37 |
|
38 |
|
39 | ## See also
|
40 |
|
41 | [bitAnd](bitAnd.md),
|
42 | [bitNot](bitNot.md),
|
43 | [bitXor](bitXor.md),
|
44 | [leftShift](leftShift.md),
|
45 | [rightArithShift](rightArithShift.md),
|
46 | [rightLogShift](rightLogShift.md)
|