mirror of
https://github.com/josdejong/mathjs.git
synced 2025-12-08 19:46:04 +00:00
900 B
900 B
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
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 |
Examples
math.bitNot(1) // returns number -2
math.bitNot([2, -3, 4]) // returns Array [-3, 2, 5]
See also
bitAnd, bitOr, bitXor, leftShift, rightArithShift, rightLogShift