UNPKG

953 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function bitAnd
4
5Bitwise AND two values, `x & y`.
6For matrices, the function is evaluated element wise.
7
8
9## Syntax
10
11```js
12math.bitAnd(x, y)
13```
14
15### Parameters
16
17Parameter | Type | Description
18--------- | ---- | -----------
19`x` | number &#124; BigNumber &#124; Array &#124; Matrix | First value to and
20`y` | number &#124; BigNumber &#124; Array &#124; Matrix | Second value to and
21
22### Returns
23
24Type | Description
25---- | -----------
26number &#124; BigNumber &#124; Array &#124; Matrix | AND of `x` and `y`
27
28
29## Examples
30
31```js
32math.bitAnd(53, 131) // returns number 1
33
34math.bitAnd([1, 12, 31], 42) // returns Array [0, 8, 10]
35```
36
37
38## See also
39
40[bitNot](bitNot.md),
41[bitOr](bitOr.md),
42[bitXor](bitXor.md),
43[leftShift](leftShift.md),
44[rightArithShift](rightArithShift.md),
45[rightLogShift](rightLogShift.md)