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