1 |
|
2 |
|
3 | # Function not
|
4 |
|
5 | Logical `not`. Flips boolean value of a given parameter.
|
6 | For matrices, the function is evaluated element wise.
|
7 |
|
8 |
|
9 | ## Syntax
|
10 |
|
11 | ```js
|
12 | math.not(x)
|
13 | ```
|
14 |
|
15 | ### Parameters
|
16 |
|
17 | Parameter | Type | Description
|
18 | --------- | ---- | -----------
|
19 | `x` | number | BigNumber | Complex | Unit | Array | Matrix | First value to check
|
20 |
|
21 | ### Returns
|
22 |
|
23 | Type | Description
|
24 | ---- | -----------
|
25 | boolean | Array | Matrix | Returns true when input is a zero or empty value.
|
26 |
|
27 |
|
28 | ## Examples
|
29 |
|
30 | ```js
|
31 | math.not(2) // returns false
|
32 | math.not(0) // returns true
|
33 | math.not(true) // returns false
|
34 |
|
35 | a = [2, -7, 0]
|
36 | math.not(a) // returns [false, false, true]
|
37 | ```
|
38 |
|
39 |
|
40 | ## See also
|
41 |
|
42 | [and](and.md),
|
43 | [or](or.md),
|
44 | [xor](xor.md)
|