The tilde (~) is a punctuation mark with many uses. Originally, it is a letter used as an abbreviation symbol, but it is also used as a phonetic symbol or a single word. Mathematically, it is a mathematical symbol representing equivalence relation. In the last use (especially in lexicography), it is sometimes used as a font size.
In C/C++ language, ~ is another operator-binary bitwise NOT operator. For example: int x = 0x79; Write binary 01111001; The result of ~x operation is 10000 1 10. That is to say: if a bit is 1, it will change to 0; if it is 0, it will change to 1.
Extended data:
In language, tilde is a diacritical sound placed on letters to indicate the change of pronunciation, such as nasalization. In the multi-tone spelling of Greek, tilde is a variant of iambic symbol.
It was used as an abbreviation in medieval Latin documents. When "n" or "m" follows a vowel, it is often ignored, and the tilde is placed above the previous vowel to indicate this ignored vowel.
This is the origin that the tilde is used to indicate nasalization. Until the17th century, the tilde on the vowel used to ignore "n" or "m" continued to be used in French publishing books to shorten the length of articles. The tilde is occasionally used in other abbreviations, such as the letter "q" to emphasize the word que (that).