.
This symbol (in English) informally means "approximately", "about", or "around", such as "~30 minutes before", meaning "approximately 30 minutes before".
It can mean "similar to", including "of the same order of magnitude as", such as: "x ~ y" meaning that x and y are of the same order of magnitude.
In Computer Programming such as C, Java and JavaScript, Tilde symbol (~) represents an operator.
For example, in JavaScript, it represents a NOT Bitwise Operator.
Read the following texts for further explanation.
.
The following table summarizes JavaScript's bitwise operators:
Operator | Usage | Description |
---|---|---|
Bitwise AND | a & b | Returns a 1 in each bit position for which the corresponding bits of both operands are 1 's. |
Bitwise OR | a | b | Returns a 1 in each bit position for which the corresponding bits of either or both operands are 1 's. |
Bitwise XOR | a ^ b | Returns a 1 in each bit position for which the corresponding bits of either but not both operands are 1 's. |
Bitwise NOT | ~ a | Inverts the bits of its operand. |
Left shift | a << b | Shifts a in binary representation b (< 32) bits to the left, shifting in 0 's from the right. |
Sign-propagating right shift | a >> b | Shifts a in binary representation b (< 32) bits to the right, discarding bits shifted off. |
Zero-fill right shift | a >>> b | Shifts a in binary representation b (< 32) bits to the right, discarding bits shifted off, and shifting in 0 's from the left. |
Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators
No comments:
Post a Comment