# ~ (Literally)

**URL:** <https://boards.straightdope.com/t/literally/184191>\
**Category:** Factual Questions\
**Created:** [June 25, 2003, 1:20am UTC](https://boards.straightdope.com/t/literally/184191 "2003-06-25T01:20:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gypsymoth3](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gypsymoth3](https://boards.straightdope.com/u/gypsymoth3)\
**Post date:** [June 25, 2003, 1:20am UTC](https://boards.straightdope.com/t/literally/184191/1 "2003-06-25T01:20:15Z")

</div>

what is this symbol (~) called? is it actually used for anything other than decorative purposes? if so, what? if not, then why is it on the keyboard instead of the character map?

---

<div class="post-metadata">

**Author:** ![Ringo](https://avatars.discourse-cdn.com/v4/letter/r/779978/32.png) [@Ringo](https://boards.straightdope.com/u/Ringo)\
**Post date:** [June 25, 2003, 1:22am UTC](https://boards.straightdope.com/t/literally/184191/2 "2003-06-25T01:22:55Z")

</div>

It’s called a _tilde_, and is often used to indicate an approximation.

---

<div class="post-metadata">

**Author:** ![Askance](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/askance/32/8281_2.png) [@Askance](https://boards.straightdope.com/u/Askance)\
**Post date:** [June 25, 2003, 1:24am UTC](https://boards.straightdope.com/t/literally/184191/3 "2003-06-25T01:24:53Z")

</div>

It’s a tilde. It is used in languages such as Spanish; the word _senor_ should have one over the “n” for instance. It changes the pronounciation from “see-nor” to “seen-your”.

It is also used in all sorts of other things, including URLs of personal web pages for some reason.

---

<div class="post-metadata">

**Author:** ![Ringo](https://avatars.discourse-cdn.com/v4/letter/r/779978/32.png) [@Ringo](https://boards.straightdope.com/u/Ringo)\
**Post date:** [June 25, 2003, 1:26am UTC](https://boards.straightdope.com/t/literally/184191/4 "2003-06-25T01:26:50Z")

</div>

[Here’s more](http://whatis.techtarget.com/liftStudySurveyQueue/0,290887,sid9,00.html) on the tilde’s job in the age of computers.

---

<div class="post-metadata">

**Author:** ![Q.E.D](https://avatars.discourse-cdn.com/v4/letter/q/51bf81/32.png) [@Q.E.D](https://boards.straightdope.com/u/Q.E.D)\
**Post date:** [June 25, 2003, 1:31am UTC](https://boards.straightdope.com/t/literally/184191/5 "2003-06-25T01:31:34Z")

</div>

That link doesn’t work for me, **Ringo**.

The _tilde_ is also used in Perl programming in the search operator:

if $search\_string =~ /‘search’/; {

&do\_stuff;

}

---

<div class="post-metadata">

**Author:** ![Ringo](https://avatars.discourse-cdn.com/v4/letter/r/779978/32.png) [@Ringo](https://boards.straightdope.com/u/Ringo)\
**Post date:** [June 25, 2003, 1:43am UTC](https://boards.straightdope.com/t/literally/184191/6 "2003-06-25T01:43:47Z")

</div>

Fixed link.

---

<div class="post-metadata">

**Author:** ![Ms2001](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ms2001/32/18463_2.png) [@Ms2001](https://boards.straightdope.com/u/Ms2001)\
**Post date:** [June 25, 2003, 2:17am UTC](https://boards.straightdope.com/t/literally/184191/7 "2003-06-25T02:17:53Z")

</div>

Tilde is also the bitwise NOT operator in C; it changes all the 1s in a binary number to 0s and vice versa.

On Unix systems, you can use “~” to refer to your own home directory, or “~someuser” to refer to someuser’s home directory.

---

<div class="post-metadata">

**Author:** ![Johanna](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johanna/32/8318_2.png) [@Johanna](https://boards.straightdope.com/u/Johanna)\
**Post date:** [June 25, 2003, 2:30am UTC](https://boards.straightdope.com/t/literally/184191/8 "2003-06-25T02:30:08Z")

</div>

**AndrewT** , no offense, _caballero_, but your Spanish pronunciation is way off.

You can type the n-with-tilde this way: (first make sure the Num Lock is on!):

1. Hold down the Alt key.
2. Type 0241 on the numerical keypad at the right end of your keyboard.
3. Let go of Alt.  
And _voilà!_ **ñ**

---

<div class="post-metadata">

**Author:** ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)\
**Post date:** [June 25, 2003, 2:30am UTC](https://boards.straightdope.com/t/literally/184191/9 "2003-06-25T02:30:14Z")

</div>

It’s used for destructors in C++ - ~MyClass() would be the destructor function for “MyClass”. This will be Greek to you unless you’re a C++ developer.

The key with “`” and “~” also functioned as the “quick kick” key in Duke Nukem, leading a colleague of mine to call C++ destructors “kick keys”.

---

<div class="post-metadata">

**Author:** ![El\_Zagna](https://avatars.discourse-cdn.com/v4/letter/e/d2c977/32.png) [@El\_Zagna](https://boards.straightdope.com/u/El_Zagna)\
**Post date:** [June 25, 2003, 2:33am UTC](https://boards.straightdope.com/t/literally/184191/10 "2003-06-25T02:33:40Z")

</div>

It usefulness in programming languages or operating systems has - or certainly should have - nothing to do with why it is on a keyboard. I can think of several characters I would use more often than a tilde, e.g., the cent sign, trademark, bullet, small square, etc.

---

<div class="post-metadata">

**Author:** ![yabob](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/yabob/32/2821_2.png) [@yabob](https://boards.straightdope.com/u/yabob)\
**Post date:** [June 25, 2003, 2:39am UTC](https://boards.straightdope.com/t/literally/184191/11 "2003-06-25T02:39:47Z")

</div>

As for why it was put there in the first place - it appeared in ASCII 65 and there are some disagreements as to the reasons. Some people attribute it to the SHARE camp within IBM. Some histories of ASCII lump it in with a group of “diacritical marks” intended to modify other characters in the restricted 7 bit space:

> [@](#):
>
> Some languages require more than the base 26 alphabetic characters; for example, É. While not a linguist nor privvy to the arguments made, I know of two approaches to this problem; a code and collation indicator for every possible accented letter, or a graphical-build-up of existing characters (eg. E, backspace, ') ignoring the collation problem. Both create non-trivial problems in representation and in collating. To make a long story short, the latter, graphical build up, was chosen. Five “punctuation” codes were designated “diacritical” marks. (A more complete solution had to wait for the extensible UNICODE, the standard used in modern HTML, which is able to reproduce things like É in a portable manner.)

From [http://www.wps.com/projects/codes/index.html](http://www.wps.com/projects/codes/index.html) which I’ve referred to before in couple other “character” threads. The five diacriticals included the tilde.

Some more musing on the matter:

[http://diveintomark.org/archives/2002/10/04/history\_of\_the\_tilde.html](http://diveintomark.org/archives/2002/10/04/history_of_the_tilde.html)

---

<div class="post-metadata">

**Author:** ![Scarlett67](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/scarlett67/32/7387_2.png) [@Scarlett67](https://boards.straightdope.com/u/Scarlett67)\
**Post date:** [June 25, 2003, 2:43am UTC](https://boards.straightdope.com/t/literally/184191/12 "2003-06-25T02:43:45Z")

</div>

You also might want to do a search on “swung dash.”

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [June 25, 2003, 3:05am UTC](https://boards.straightdope.com/t/literally/184191/13 "2003-06-25T03:05:31Z")

</div>

> [@](#):
>
> \*Originally posted by bnorton \*  
> \*\*It usefulness in programming languages or operating systems has - or certainly should have - nothing to do with why it is on a keyboard. I can think of several characters I would use more often than a tilde, e.g., the cent sign, trademark, bullet, small square, etc. \*\*

Eh, first off, who do you think created ASCII, and what purpose do you think they created it for? Hint: Liberal arts majors weren’t high on the timesharing schedules of the 1960s.

Secondly, why do you think computer languages chose the characters they did to do the jobs they do? It’s not very convenient to have to use a space-cadet keyboard and/or nonstandard keymaps just to modify your source code.

Thirdly, why did keyboard makers all decide to put the same keys on their keyboard? Could it have something to do with standards such as ASCII?

I really don’t get your dismissive tone, **bnorton**. The whole industry (save some sectors of IBM) has standardized on ASCII, which isn’t perfect by any means but at least serves as a machine-independent way to transmit and store text. Such standardization is rare, as the fragmentation of `extended ASCII’ during the 1980s and pre-Unicode 90s proved. Unicode is quickly catching on, and when it’s ready, I suppose you’ll be able to have keyboards with Celtic runes on them if you so desire.

---

<div class="post-metadata">

**Author:** ![SmackFu](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@SmackFu](https://boards.straightdope.com/u/SmackFu)\
**Post date:** [June 25, 2003, 3:54am UTC](https://boards.straightdope.com/t/literally/184191/14 "2003-06-25T03:54:08Z")

</div>

Interesting trivia: In the same vein as the tilde meaning it’s various programming meanings, IBM mainframes use a different symbol for the ! in != constructions (at least in PL/I and DB2 they do), the EBCDIC **¬** (looks like a dash with a hanging tail on the right if it’s not in your character set). I think it was a key on the IBM 3270 terminals which has since bit the dust.

Now that one, I don’t know which came first, the keyboard or the programming usage. I’ve never seen that used in any other context like the tilde is.

---

<div class="post-metadata">

**Author:** ![Daver914](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@Daver914](https://boards.straightdope.com/u/Daver914)\
**Post date:** [June 25, 2003, 4:14am UTC](https://boards.straightdope.com/t/literally/184191/15 "2003-06-25T04:14:21Z")

</div>

The tilde is definitely not decorative! It’s used in Spanish to change the letter “n” (ene) into a different letter altogether, ñ (eñe). The ñ phoneme sounds like ‘ny’ in English ‘canyon’.

The tilde is also used in Portuguese to indicate nasalization with the vowels a and o. My Portuguese isn’t very good, but I do know that a and ã, and o and õ don’t sound much alike.

Some other languages have probably also adapted the tilde as a diacritic, but I don’t have a specific example. Anyone?

---

<div class="post-metadata">

**Author:** ![Daver914](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@Daver914](https://boards.straightdope.com/u/Daver914)\
**Post date:** [June 25, 2003, 4:21am UTC](https://boards.straightdope.com/t/literally/184191/16 "2003-06-25T04:21:52Z")

</div>

Another use that I’ve thought of. When I took a formal logic class (i.e. if x then y, modus tollens, all that nonsense) last year, tilde was used as the negation operator. For example:

Let F= the proposition “Frank went to Chicago”  
~F = “Frank did not go to Chicago” (the negation of F)

With regard to SmackFu’s bit of trivia/ponderment, the hook (¬) is used interchangeably to mean “NOT”. It seems to be more prevalent in mathematical and scientific contexts, so this could be why it was used in this context on the IBM 3270 and included on the keyboard.

---

<div class="post-metadata">

**Author:** ![Ms2001](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ms2001/32/18463_2.png) [@Ms2001](https://boards.straightdope.com/u/Ms2001)\
**Post date:** [June 25, 2003, 9:27am UTC](https://boards.straightdope.com/t/literally/184191/17 "2003-06-25T09:27:54Z")

</div>

On IRC, a tilde before someone’s address means their identity couldn’t be verified.

Some dictionaries use ~ to abbreviate the root word in the usage examples.

---

<div class="post-metadata">

**Author:** ![dylan\_73](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@dylan\_73](https://boards.straightdope.com/u/dylan_73)\
**Post date:** [June 25, 2003, 10:55am UTC](https://boards.straightdope.com/t/literally/184191/18 "2003-06-25T10:55:31Z")

</div>

> [@](#):
>
> \*Originally posted by AndrewT \*  
> \*\*It is also used in all sorts of other things, including URLs of personal web pages for some reason. \*\*

The reason is that on a Unix style system, the tilde is used as a shortcut to indicate the home directory. So “cd ~” might take me to /home/dylan73 and “cd ~someone” would take me to /home/someone.

Web servers running on these systems will sometimes adopt the same shortcut, so [http://www.anywhere.com/~dylan73/](http://www.anywhere.com/~dylan73/) might get you files from /home/dylan73/public\_html or whatever it’s set up for.

---

<div class="post-metadata">

**Author:** ![green\_bladder](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@green\_bladder](https://boards.straightdope.com/u/green_bladder)\
**Post date:** [June 25, 2003, 11:21am UTC](https://boards.straightdope.com/t/literally/184191/19 "2003-06-25T11:21:52Z")

</div>

> [@](#):
>
> \*Originally posted by Jomo Mojo \*  
> \*\* You can type the n-with-tilde this way: (first make sure the Num Lock is on!):
> 
> 1. Hold down the Alt key.
> 2. Type 0241 on the numerical keypad at the right end of your keyboard.
> 3. Let go of Alt.  
> And _voilà!_ **ñ** \*\*

I prefer Alt+164… (ñ) But why would they have two different combinations to enter the same symbol?

---

<div class="post-metadata">

**Author:** ![Shalmanese](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Shalmanese](https://boards.straightdope.com/u/Shalmanese)\
**Post date:** [June 25, 2003, 11:51am UTC](https://boards.straightdope.com/t/literally/184191/20 "2003-06-25T11:51:54Z")

</div>

> [@](#):
>
> \*Originally posted by Derleth \*  
> \*\*Eh, first off, who do you think created ASCII, and what purpose do you think they created it for? Hint: Liberal arts majors weren’t high on the timesharing schedules of the 1960s. \*\*

Eh, who do you think were designing these programming languages? People writing on KEYBOARDS. Tildas got incorporated into programming languages BECAUSE they were on keyboards, not the other way around. The earlier reason was right, if you wanted to write an ñ ascii, you had to use ~n.

[Next page](https://boards.straightdope.com/t/literally/184191.md?page=2)
