52 lines
952 B
Markdown
52 lines
952 B
Markdown
|
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||
|
|
||
|
# Function bitNot
|
||
|
|
||
|
Bitwise NOT value, `~x`.
|
||
|
For matrices, the function is evaluated element wise.
|
||
|
For units, the function is evaluated on the best prefix base.
|
||
|
|
||
|
|
||
|
## Syntax
|
||
|
|
||
|
```js
|
||
|
math.bitNot(x)
|
||
|
```
|
||
|
|
||
|
### Parameters
|
||
|
|
||
|
Parameter | Type | Description
|
||
|
--------- | ---- | -----------
|
||
|
`x` | number | BigNumber | Array | Matrix | Value to not
|
||
|
|
||
|
### Returns
|
||
|
|
||
|
Type | Description
|
||
|
---- | -----------
|
||
|
number | BigNumber | Array | Matrix | NOT of `x`
|
||
|
|
||
|
|
||
|
### Throws
|
||
|
|
||
|
Type | Description
|
||
|
---- | -----------
|
||
|
|
||
|
|
||
|
## Examples
|
||
|
|
||
|
```js
|
||
|
math.bitNot(1) // returns number -2
|
||
|
|
||
|
math.bitNot([2, -3, 4]) // returns Array [-3, 2, 5]
|
||
|
```
|
||
|
|
||
|
|
||
|
## See also
|
||
|
|
||
|
[bitAnd](bitAnd.md),
|
||
|
[bitOr](bitOr.md),
|
||
|
[bitXor](bitXor.md),
|
||
|
[leftShift](leftShift.md),
|
||
|
[rightArithShift](rightArithShift.md),
|
||
|
[rightLogShift](rightLogShift.md)
|