Tilde
Encyclopedia
The tilde is a grapheme with several uses. The name of the character comes from Portuguese
and Spanish
, from the Latin
titulus meaning "title" or "superscription", though the term "tilde" has evolved and now has a different meaning in linguistics
.
It was originally written over a letter as a mark of abbreviation
, but has since acquired a number of other uses as a diacritic
mark or a character in its own right. These are encoded in Unicode at and . And there are additional similar characters for different roles. In lexicography
, the tilde as a separate character or swung dash is used in dictionaries to indicate the omission of the entry word.
as", such as "x ~ y" meaning that x and y are of the same order of magnitude. Another approximation
symbol is ≈, meaning "approximately equal to."
al mark ( ˜ ) placed over a letter
to indicate a change in pronunciation, such as nasalization
.
of Ancient Greek
, as a variant of the circumflex
, representing a rise in pitch
followed by a return to standard pitch.
s in medieval Latin documents. When an ⟨n⟩ or ⟨m⟩ followed a vowel, it was often omitted, and a tilde (i.e., a small ⟨n⟩) was placed over the preceding vowel to indicate the missing letter; this is the origin of the use of tilde to indicate nasalization. (Compare the development of the umlaut as an abbreviation of ⟨e⟩.) The practice of using the tilde over a vowel to indicate omission of an ⟨n⟩ or ⟨m⟩ continued in printed books in French
as a means of reducing text length until the 17th century. It was also used in Portuguese
, Catalan
and Spanish
.
The tilde was also used occasionally to make other abbreviations, such as over the letter ⟨q⟩ ("q̃") to signify the word que ("that").
in old Galician-Portuguese. It indicates nasalization of the base vowel: mão "hand", from Lat. manu-; razões "reasons", from Lat. rationes. Current languages and alphabets in which the tilde is used as a sign of nasalization
include:
In Breton
, the symbol ⟨ñ⟩ after a vowel means that the letter ⟨n⟩ serves only to give the vowel a nasalised pronunciation, without being itself pronounced, as it normally is. For example ⟨an⟩ gives the pronunciation [ãn] whereas ⟨añ⟩ gives [ã].
(ˈeɲe), rather than a letter-diacritic combination; it is placed in Spanish dictionaries between the letters ⟨n⟩ and ⟨o⟩. In addition, the word tilde can refer to any diacritic in this language; for example, the acute accent in José is also called a tilde in Spanish. Current languages in which the tilded ⟨n⟩ (⟨ñ⟩) is used for the palatal nasal
consonant /ɲ/ include:
, a tilde over a vowel represents a dipping tone
(ngã).
, a tilde is used as a diacritic either placed above a letter, below it or superimposed onto the middle of it (see International Phonetic Alphabet → Diacritics):
, the symbol ⟨õ⟩ stands for the close-mid back unrounded vowel
, and it is considered an independent letter.
characters similar to the tilde.
(instead of an unspaced hyphen
or en-dash) between two number
s, to indicate a range
rather than subtraction
or a hyphenated number (such as a part number or model number). For example, 12~15 means "12 to 15", ~3 means "up to three" and 100~ means "100 and greater". Japanese and other East Asian languages
almost always use this convention, but it is often done for clarity in some other languages as well. Chinese
uses the wavy dash and full-width em dash interchangeably for this purpose. In English, the tilde is often used to express ranges and model numbers in electronics
but rarely in formal grammar or type-set documents, as a wavy dash preceding a number sometimes represents an approximation (see the Mathematics section, below).
is used in English.
When used in conversations via email or instant messenger it may be used as a sarcasm mark or, in East Asia, as an extension of the final syllable to produce the same effect as “whyyyyyy” with “why〜〜”. Used at the end of a word or sentence in text communications, it often denotes something said in a sing-song or playful voice, or similar to the use in instant messengers and email, depending on context. In some contexts, the tilde represents a lustful or exhausted sigh: "Hello there~."
(Microsoft's code page
for Japanese), a widely-used extension of Shift JIS, in order to avoid the shape definition error in Unicode: the wave dash glyph in JIS/Shift JIS is identical to the Unicode reference glyph for U+FF5E, while the reference glyph for U+301C was incorrectly turned upside down when Unicode imported the JIS wave dash. In other platforms such as Mac OS and Mac OS X, 0x8160 is correctly mapped to U+301C. It is generally difficult, if not impossible, for Windows users in Japan to type U+301C, especially in legacy, non-Unicode applications.
Nevertheless, the Japanese wave dash is still formally mapped to U+301C as of JIS X 0213
. Those two code points have the identical or very similar glyph in several fonts, reducing the confusion and incompatibility.
, the tilde operator (Unicode U+223C), sometimes called “twiddle”, is often used to denote an equivalence relation
between two objects. Thus “x ~ y” means “x is equivalent to y”. (Note that this is quite different from stating that x equals y.) The expression “x ~ y” is sometimes read aloud as “x twiddles y”, perhaps as an analogue to the verbal expression of “x = y”.
The tilde is also used as a modifier for symbols. The symbol “” is often pronounced “eff twiddle” or, particularly in American English, “eff wiggle”.
This can be used to denote the Fourier transform
of f, or a lift
of f, and can have a variety of other meanings depending on the context.
The tilde can indicate approximate equality in a variety of ways. It can be used to denote the asymptotic equality
of two functions. For example, f(x) ~ g(x), means that limx→∞ f(x)/g(x) = 1. A tilde is also used to indicate “approximately equal to” (e.g. 1.902 ~= 2). This usage probably developed as a typed alternative to the libra symbol used for the same purpose in written mathematics, which is an equal sign (=) with the upper bar replaced by a bar with an upward hump or loop in the middle or, sometimes, a tilde (≃). The symbol "≈" is also used for this purpose. Similarly, a tilde can be used on its own between two expressions (e.g. a ~ 0.1) to state that the two are of the same order of magnitude
.
In statistics
and probability theory
, ⟨~⟩ means “is distributed as”. See random variable
. A tilde placed on top of a variable is sometimes used to represent the median of that variable.
A tilde can also be used to represent geometric similarity
, for example: ∆ABC ~ ∆DEF (meaning "triangle
ABC is similar to triangle DEF"). A triple tilde () is often used to show congruence
, an equivalence relation in geometry.
A tilde placed below a letter in mathematics can represent a vector quantity.
, the tilde represents negation
: “~p” means “not p”, where "p" is a proposition
. Modern use has been replacing the tilde with the negation symbol (¬) for this purpose, to avoid confusion with equivalence relation
s.
223F), which is used in electronics
to indicate alternating current
, in place of +, −, or for direct current
.
-like operating system
s (including BSD, GNU/Linux and Mac OS X
), tilde often indicates the current user's home directory
: for example, if the current user's home directory is /home/bloggsj, then cd, cd ~, cd /home/bloggsj or cd $HOME are equivalent. This practice derives from the Lear-Siegler ADM-3A
terminal in common use during the 1970s, which happened to have the tilde symbol and the word "Home" (for moving the cursor to the upper left) on the same key. When prepended to a particular username, the tilde indicates that user's home directory (e.g., ~janedoe for the home directory of user janedoe, such as /home/janedoe).
Used in URLs
on the World Wide Web
, it often denotes a personal website on a Unix
-based server. For example,http://www.example.com/~johndoe/ might be the personal web site of John Doe. This mimics the Unix shell usage of the tilde. However, when accessed from the web, file access is usually directed to a subdirectory in the user's home directory, such as /home/username/public_html or /home/username/www.
In URLs, the characters %7E
(or %7e) may substitute for tilde if an input device lacks a tilde key. Thus,http://www.example.com/~johndoe/ and http://www.example.com/%7Ejohndoe/ will behave in the same manner.
as part of the pattern match operators for regular expression
s:
A variant of this, with the plain tilde replaced with
, and this semi-standardization has led to the use of these operators in other programming languages, such as Ruby or the SQL
variant of the database PostgreSQL
.
In APL and Matlab, tilde represents the monadic logical function NOT.
In the C
, C++
and C# programming languages, the tilde character is used as an operator
to invert all bit
s of an integer
(bitwise NOT), following the notation in logic (an
's method
name (where the rest of the name must be the same name as the class) to indicate a destructor
– a special method which is called at the end of the object's life
.
In the CSS
stylesheet language, the tilde is used for the indirect adjacent combinator as part of a selector.
In the D programming language, the tilde is used as an array concatenation
operator, as well as to indicate an object destructor and binary not operator. Tilde operator can be overloaded for user types, and binary tilde operator is mostly used to merging two objects, or adding some objects to set of objects. It was introduced because plus operator can have different meaning in many situations. For example what to do with "120" + "14" ? Is this a string "134" (addition of two numbers), or "12014" (concatenation of strings) or something else? D disallows + operator for arrays (and strings), and provides separate operator for concatenation (similarly PHP
programming language solved this problem by using dot operator for concatenation, and + for number addition, which will also work on strings containing numbers).
In Eiffel
, the tilde is used for object comparison. If a and b denote objects, the boolean expression a ~ b has value true if an only if these objects are equal, as defined by the applicable version of the library routine is_equal, which by default denotes field-by-field object equality but can be redefined in any class to support a specific notion of equality. If a and b are references, the object equality expression a ~ b is to be contrasted with a = b which denotes reference equality. Unlike the call a.is_equal (b), the expression a ~ b is type-safe
even in the presence of covariance
.
In the Groovy programming language the tilde character is used as an operator mapped to the bitwiseNegate method. Given a String the method will produce a java.util.regex.Pattern. Given an integer it will negate the integer bitwise like in different C variants.
In Haskell
, the tilde is used in type constraints to indicate type equality; also, in pattern-matching patterns, the tilde makes a subpattern irrefutable.
In the Inform
programming language, the tilde is used to indicate a quotation mark inside a quoted string.
In "text mode" of the LaTeX
typesetting language a tilde diacritic can be obtained using, e.g.,
In "math mode" a tilde diacritic can be written as, e.g.,
In both text and math mode, a tilde on its own (
In Common Lisp
, the tilde is used as the prefix for format specifiers in format strings.
In Max/MSP, a tilde is used to denote objects that process at the computer's sampling rate, i.e. mainly those that deal with sound.
In Standard ML
, the tilde is used as the prefix for negative numbers and as the unary negation operator.
In OCaml, the tilde is used to specify the label for a labeled parameter.
In Microsoft's SQL Server Transact-SQL (T-SQL)
language, the tilde is a unary Bitwise NOT operator.
convention for naming backup copies of files is appending a tilde to the original file name.
It originated with the Emacs
text editor and was adopted by many other editors and some command-line tools.
Emacs also introduced an elaborate numbered backup scheme, with files named filename.~1~, filename.~2~ and so on. It didn't catch on, probably because version control software does this better.
's filename mangling
scheme when it developed the FAT
file system. This upgrade introduced long filenames to Microsoft Windows
, and permitted additional characters (such as the space) to be part of filenames, which were prohibited in previous versions. Programs written prior to this development could only access filenames in the so-called 8.3 format—the filenames consisted of a maximum of eight alphanumeric characters, followed by a period, followed by three more alphanumeric characters. In order to permit these legacy programs to access files in the FAT file system, each file had to be given two names—one long, more descriptive one, and one that conformed to the 8.3 format. This was accomplished with a name-mangling scheme in which the first six characters of the filename are followed by a tilde and a digit. For example, "Program Files" might become "PROGRA~1".
Also, the tilde symbol is used to prefix hidden temporary files that are created when a document is opened in Windows. For example, when you open a Word document called "Document1.doc," a file called "~$cument1.doc" is created in the same directory. This file contains information about which user has the file open, to prevent multiple users from attempting to change a document at the same time.
, Quake, Half-Life 2
, Soldier of Fortune II: Double Helix
, Unreal
, Counter-Strike
, Crysis
, Oblivion
, RuneScape
, and others based on the Quake engine
or Source engine.
It is sometimes used in Rogue-like games to represent water or snakes.
, other synonyms sometimes used in programming include not, approx, wiggle, enyay (after eñe
) and (humorously) sqiggle (ˈ).
In Perl 6
, "~~ " is used instead of "=~".
Juggling notation
Keyboards
Where a tilde is on the keyboard depends on the computer's language settings according to the following chart. On many keyboards it is primarily available through a dead key
that makes it possible to produce a variety of precomposed character
s with the diacritic. In that case, a single tilde can typically be inserted with the dead key followed by the space bar, or alternatively by striking the dead key twice in a row.
To insert a tilde with the dead key, it is often necessary to simultaneously hold down the Alt Gr key. On the keyboard layouts that include an Alt Gr key, it typically takes the place of the right-hand Alt key
. With a Macintosh
either of the Alt/Option
keys function similarly.
In the US and European Windows systems, the Alt code for a single tilde is
>
External links
Portuguese language
Portuguese is a Romance language that arose in the medieval Kingdom of Galicia, nowadays Galicia and Northern Portugal. The southern part of the Kingdom of Galicia became independent as the County of Portugal in 1095...
and Spanish
Spanish language
Spanish , also known as Castilian , is a Romance language in the Ibero-Romance group that evolved from several languages and dialects in central-northern Iberia around the 9th century and gradually spread with the expansion of the Kingdom of Castile into central and southern Iberia during the...
, from the Latin
Latin
Latin is an Italic language originally spoken in Latium and Ancient Rome. It, along with most European languages, is a descendant of the ancient Proto-Indo-European language. Although it is considered a dead language, a number of scholars and members of the Christian clergy speak it fluently, and...
titulus meaning "title" or "superscription", though the term "tilde" has evolved and now has a different meaning in linguistics
Linguistics
Linguistics is the scientific study of human language. Linguistics can be broadly broken into three categories or subfields of study: language form, language meaning, and language in context....
.
It was originally written over a letter as a mark of abbreviation
Abbreviation
An abbreviation is a shortened form of a word or phrase. Usually, but not always, it consists of a letter or group of letters taken from the word or phrase...
, but has since acquired a number of other uses as a diacritic
Diacritic
A diacritic is a glyph added to a letter, or basic glyph. The term derives from the Greek διακριτικός . Diacritic is both an adjective and a noun, whereas diacritical is only an adjective. Some diacritical marks, such as the acute and grave are often called accents...
mark or a character in its own right. These are encoded in Unicode at and . And there are additional similar characters for different roles. In lexicography
Lexicography
Lexicography is divided into two related disciplines:*Practical lexicography is the art or craft of compiling, writing and editing dictionaries....
, the tilde as a separate character or swung dash is used in dictionaries to indicate the omission of the entry word.
Common use
This symbol (in English) sometimes means "approximately", such as "~30 minutes ago" meaning "approximately 30 minutes ago". It can mean "similar to", including "of the same order of magnitudeOrder of magnitude
An order of magnitude is the class of scale or magnitude of any amount, where each class contains values of a fixed ratio to the class preceding it. In its most common usage, the amount being scaled is 10 and the scale is the exponent being applied to this amount...
as", such as "x ~ y" meaning that x and y are of the same order of magnitude. Another approximation
Approximation
An approximation is a representation of something that is not exact, but still close enough to be useful. Although approximation is most often applied to numbers, it is also frequently applied to such things as mathematical functions, shapes, and physical laws.Approximations may be used because...
symbol is ≈, meaning "approximately equal to."
Diacritical use
In some languages, the tilde is used as a diacriticDiacritic
A diacritic is a glyph added to a letter, or basic glyph. The term derives from the Greek διακριτικός . Diacritic is both an adjective and a noun, whereas diacritical is only an adjective. Some diacritical marks, such as the acute and grave are often called accents...
al mark ( ˜ ) placed over a letter
Letter (alphabet)
A letter is a grapheme in an alphabetic system of writing, such as the Greek alphabet and its descendants. Letters compose phonemes and each phoneme represents a phone in the spoken form of the language....
to indicate a change in pronunciation, such as nasalization
Nasalization
In phonetics, nasalization is the production of a sound while the velum is lowered, so that some air escapes through the nose during the production of the sound by the mouth...
.
Pitch
It was first used in the polytonic orthographyGreek diacritics
Greek orthography has used a variety of diacritics starting in the Hellenistic period. The complex polytonic orthography notates Ancient Greek phonology...
of Ancient Greek
Ancient Greek
Ancient Greek is the stage of the Greek language in the periods spanning the times c. 9th–6th centuries BC, , c. 5th–4th centuries BC , and the c. 3rd century BC – 6th century AD of ancient Greece and the ancient world; being predated in the 2nd millennium BC by Mycenaean Greek...
, as a variant of the circumflex
Circumflex
The circumflex is a diacritic used in the written forms of many languages, and is also commonly used in various romanization and transcription schemes. It received its English name from Latin circumflexus —a translation of the Greek περισπωμένη...
, representing a rise in pitch
Pitch accent
Pitch accent is a linguistic term of convenience for a variety of restricted tone systems that use variations in pitch to give prominence to a syllable or mora within a word. The placement of this tone or the way it is realized can give different meanings to otherwise similar words...
followed by a return to standard pitch.
Abbreviation
Later, it was used to make abbreviationScribal abbreviation
Scribal abbreviations are the abbreviations used by ancient and mediæval scribes writing in Latin and, later, in Greek and Old Norse...
s in medieval Latin documents. When an ⟨n⟩ or ⟨m⟩ followed a vowel, it was often omitted, and a tilde (i.e., a small ⟨n⟩) was placed over the preceding vowel to indicate the missing letter; this is the origin of the use of tilde to indicate nasalization. (Compare the development of the umlaut as an abbreviation of ⟨e⟩.) The practice of using the tilde over a vowel to indicate omission of an ⟨n⟩ or ⟨m⟩ continued in printed books in French
French language
French is a Romance language spoken as a first language in France, the Romandy region in Switzerland, Wallonia and Brussels in Belgium, Monaco, the regions of Quebec and Acadia in Canada, and by various communities elsewhere. Second-language speakers of French are distributed throughout many parts...
as a means of reducing text length until the 17th century. It was also used in Portuguese
Portuguese language
Portuguese is a Romance language that arose in the medieval Kingdom of Galicia, nowadays Galicia and Northern Portugal. The southern part of the Kingdom of Galicia became independent as the County of Portugal in 1095...
, Catalan
Catalan language
Catalan is a Romance language, the national and only official language of Andorra and a co-official language in the Spanish autonomous communities of Catalonia, the Balearic Islands and Valencian Community, where it is known as Valencian , as well as in the city of Alghero, on the Italian island...
and Spanish
Spanish language
Spanish , also known as Castilian , is a Romance language in the Ibero-Romance group that evolved from several languages and dialects in central-northern Iberia around the 9th century and gradually spread with the expansion of the Kingdom of Castile into central and southern Iberia during the...
.
The tilde was also used occasionally to make other abbreviations, such as over the letter ⟨q⟩ ("q̃") to signify the word que ("that").
Nasalization
It is also as a small ⟨n⟩ that the tilde originated when written above another letters, marking a Latin ⟨n⟩ which had been elidedElision
Elision is the omission of one or more sounds in a word or phrase, producing a result that is easier for the speaker to pronounce...
in old Galician-Portuguese. It indicates nasalization of the base vowel: mão "hand", from Lat. manu-; razões "reasons", from Lat. rationes. Current languages and alphabets in which the tilde is used as a sign of nasalization
Nasalization
In phonetics, nasalization is the production of a sound while the velum is lowered, so that some air escapes through the nose during the production of the sound by the mouth...
include:
- PortuguesePortuguese languagePortuguese is a Romance language that arose in the medieval Kingdom of Galicia, nowadays Galicia and Northern Portugal. The southern part of the Kingdom of Galicia became independent as the County of Portugal in 1095...
- Several native languages of South AmericaIndigenous languages of the AmericasIndigenous languages of the Americas are spoken by indigenous peoples from Alaska and Greenland to the southern tip of South America, encompassing the land masses which constitute the Americas. These indigenous languages consist of dozens of distinct language families as well as many language...
, such as GuaraniGuaraní languageGuaraní, specifically the primary variety known as Paraguayan Guaraní , is an indigenous language of South America that belongs to the Tupí–Guaraní subfamily of the Tupian languages. It is one of the official languages of Paraguay , where it is spoken by the majority of the population, and half of...
and NheengatuNheengatuThe Nheengatu language , often spelled Nhengatu, is an Amerindian language of a Tupi–Guarani family. It is also known by the Portuguese names língua geral da Amazônia and língua geral amazônica, both meaning "Amazonian General Language," or even by the Latin lingua brasilica...
, inherited from Portuguese. - In the International Phonetic AlphabetInternational Phonetic AlphabetThe International Phonetic Alphabet "The acronym 'IPA' strictly refers [...] to the 'International Phonetic Association'. But it is now such a common practice to use the acronym also to refer to the alphabet itself that resistance seems pedantic...
(IPA) and many other phonetic alphabets. For example, [ljɔ̃] is the transcription of the pronunciation of the word "Lyon" in French (inherited from Portuguese as well).
In Breton
Breton language
Breton is a Celtic language spoken in Brittany , France. Breton is a Brythonic language, descended from the Celtic British language brought from Great Britain to Armorica by migrating Britons during the Early Middle Ages. Like the other Brythonic languages, Welsh and Cornish, it is classified as...
, the symbol ⟨ñ⟩ after a vowel means that the letter ⟨n⟩ serves only to give the vowel a nasalised pronunciation, without being itself pronounced, as it normally is. For example ⟨an⟩ gives the pronunciation [ãn] whereas ⟨añ⟩ gives [ã].
Palatal n
The tilded ⟨n⟩ (⟨ñ⟩, ⟨Ñ⟩) developed from the digraph ⟨nn⟩ in Spanish. In this language, ⟨ñ⟩ is considered a separate letter called eñeÑ
Ñ is a letter of the modern Latin alphabet, formed by an N with a diacritical tilde. It is used in the Spanish alphabet, Galician alphabet, Asturian alphabet, Basque alphabet, Aragonese old alphabet , Filipino alphabet, Chamorro alphabet and the Guarani alphabet, where it represents...
(ˈeɲe), rather than a letter-diacritic combination; it is placed in Spanish dictionaries between the letters ⟨n⟩ and ⟨o⟩. In addition, the word tilde can refer to any diacritic in this language; for example, the acute accent in José is also called a tilde in Spanish. Current languages in which the tilded ⟨n⟩ (⟨ñ⟩) is used for the palatal nasal
Palatal nasal
The palatal nasal is a type of consonant, used in some spoken languages. The symbol in the International Phonetic Alphabet that represents this sound is , a lowercase letter n with a leftward-pointing tail protruding from the bottom of the left stem of the letter. The equivalent X-SAMPA symbol is J...
consonant /ɲ/ include:
- AsturianAsturian languageAsturian is a Romance language of the West Iberian group, Astur-Leonese Subgroup, spoken in the Spanish Region of Asturias by the Asturian people...
- BasqueBasque languageBasque is the ancestral language of the Basque people, who inhabit the Basque Country, a region spanning an area in northeastern Spain and southwestern France. It is spoken by 25.7% of Basques in all territories...
- FilipinoFilipino languageThis move has drawn much criticism from other regional groups.In 1987, a new constitution introduced many provisions for the language.Article XIV, Section 6, omits any mention of Tagalog as the basis for Filipino, and states that:...
- GalicianGalician languageGalician is a language of the Western Ibero-Romance branch, spoken in Galicia, an autonomous community located in northwestern Spain, where it is co-official with Castilian Spanish, as well as in border zones of the neighbouring territories of Asturias and Castile and León.Modern Galician and...
- GuaraníGuaraní languageGuaraní, specifically the primary variety known as Paraguayan Guaraní , is an indigenous language of South America that belongs to the Tupí–Guaraní subfamily of the Tupian languages. It is one of the official languages of Paraguay , where it is spoken by the majority of the population, and half of...
- MapudungunMapudungunThe Mapuche language, Mapudungun is a language isolate spoken in south-central Chile and west central Argentina by the Mapuche people. It is also spelled Mapuzugun and sometimes called Mapudungu or Araucanian...
- PapiamentoPapiamentoPapiamento is the most widely spoken language on the Caribbean ABC islands, having the official status on the islands of Aruba and Curaçao. The language is also recognized on Bonaire by the Dutch government....
- SpanishSpanish languageSpanish , also known as Castilian , is a Romance language in the Ibero-Romance group that evolved from several languages and dialects in central-northern Iberia around the 9th century and gradually spread with the expansion of the Kingdom of Castile into central and southern Iberia during the...
- TetumTetum languageTetum is an Austronesian language, a national language and one of the two official languages of East Timor. It is also used in parts of West Timor that adjoin East Timor, particularly in Belu Regency...
Tone
In VietnameseVietnamese language
Vietnamese is the national and official language of Vietnam. It is the mother tongue of 86% of Vietnam's population, and of about three million overseas Vietnamese. It is also spoken as a second language by many ethnic minorities of Vietnam...
, a tilde over a vowel represents a dipping tone
Tone (linguistics)
Tone is the use of pitch in language to distinguish lexical or grammatical meaning—that is, to distinguish or inflect words. All verbal languages use pitch to express emotional and other paralinguistic information, and to convey emphasis, contrast, and other such features in what is called...
(ngã).
International Phonetic Alphabet
In phoneticsPhonetics
Phonetics is a branch of linguistics that comprises the study of the sounds of human speech, or—in the case of sign languages—the equivalent aspects of sign. It is concerned with the physical properties of speech sounds or signs : their physiological production, acoustic properties, auditory...
, a tilde is used as a diacritic either placed above a letter, below it or superimposed onto the middle of it (see International Phonetic Alphabet → Diacritics):
- A tilde above a letter indicates nasalizationNasalizationIn phonetics, nasalization is the production of a sound while the velum is lowered, so that some air escapes through the nose during the production of the sound by the mouth...
, e.g. [ã], [ṽ]. - A tilde superimposed onto the middle of a letter indicates velarizationVelarizationVelarization is a secondary articulation of consonants by which the back of the tongue is raised toward the velum during the articulation of the consonant.In the International Phonetic Alphabet, velarization is transcribed by one of three diacritics:...
or pharyngealization, e.g. [ɫ], [z̴]. If no precomposed unicodeUnicodeUnicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...
character exists, the unicode character 'COMBINING TILDE OVERLAY' (U+0334) " ̴ " can be used to generate one. - A tilde below a letter indicates laryngealisationCreaky voiceIn linguistics, creaky voice , is a special kind of phonation in which the arytenoid cartilages in the larynx are drawn together; as a result, the vocal folds are compressed rather tightly, becoming relatively slack and compact...
, e.g. [d̰]. If no precomposed unicode character exists, the unicode character 'COMBINING TILDE BELOW' (U+0330) " ̰ " can be used to generate one.
Letter extension
In EstonianEstonian language
Estonian is the official language of Estonia, spoken by about 1.1 million people in Estonia and tens of thousands in various émigré communities...
, the symbol ⟨õ⟩ stands for the close-mid back unrounded vowel
Close-mid back unrounded vowel
The close-mid back unrounded vowel, or high-mid back unrounded vowel, is a type of vowel sound, used in some spoken languages. Its symbol in the International Phonetic Alphabet is , called "ram's horns"...
, and it is considered an independent letter.
Other uses
Some languages and alphabets use the tilde for other purposes:- ArabicArabic languageArabic is a name applied to the descendants of the Classical Arabic language of the 6th century AD, used most prominently in the Quran, the Islamic Holy Book...
: A symbol resembling the tilde (madda) is used over the letter ⟨ا⟩ to become ⟨آ⟩, denoting a long /aː/ sound ([ʔæː]). - GuaraníGuaraní languageGuaraní, specifically the primary variety known as Paraguayan Guaraní , is an indigenous language of South America that belongs to the Tupí–Guaraní subfamily of the Tupian languages. It is one of the official languages of Paraguay , where it is spoken by the majority of the population, and half of...
: The tilded ⟨G̃⟩ (note that ⟨G/g⟩ with tilde is not available as a precomposed glyph in UnicodeUnicodeUnicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...
) stands for the velar nasalVelar nasalThe velar nasal is the sound of ng in English sing. It is a type of consonantal sound, used in some spoken languages. The symbol in the International Phonetic Alphabet that represents this sound is , and the equivalent X-SAMPA symbol is N....
consonant. Also, the tilded ⟨y⟩ (⟨Ỹ⟩) stands for the nasalized upper central rounded vowel [ɨ̃]. - UnicodeUnicodeUnicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...
has a combiningCombining characterIn digital typography, combining characters are characters that are intended to modify other characters. The most common combining characters in the Latin script are the combining diacritical marks ....
vertical tilde character, (U+033E). It is used to indicate middle tone in linguistic transcription of certain dialects of the Lithuanian languageLithuanian languageLithuanian is the official state language of Lithuania and is recognized as one of the official languages of the European Union. There are about 2.96 million native Lithuanian speakers in Lithuania and about 170,000 abroad. Lithuanian is a Baltic language, closely related to Latvian, although they...
and for transliteration of the Cyrillic palatalization sign, (U+0484).
Similar characters
There are a number of UnicodeUnicode
Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...
characters similar to the tilde.
Character | Code point | Name | Comments |
---|---|---|---|
~ | U+007E | TILDE | |
˜ | U+02DC | SMALL TILDE | |
◌̃ | U+0303 | COMBINING TILDE | |
◌̰ | U+0330 | COMBINING TILDE BELOW | Used in IPA International Phonetic Alphabet The International Phonetic Alphabet "The acronym 'IPA' strictly refers [...] to the 'International Phonetic Association'. But it is now such a common practice to use the acronym also to refer to the alphabet itself that resistance seems pedantic... to indicate creaky voice Creaky voice In linguistics, creaky voice , is a special kind of phonation in which the arytenoid cartilages in the larynx are drawn together; as a result, the vocal folds are compressed rather tightly, becoming relatively slack and compact... |
◌̴ | U+0334 | COMBINING TILDE OVERLAY | Used in IPA to indicate velarization Velarization Velarization is a secondary articulation of consonants by which the back of the tongue is raised toward the velum during the articulation of the consonant.In the International Phonetic Alphabet, velarization is transcribed by one of three diacritics:... or pharyngealization |
ס֘ | U+0598 | HEBREW ACCENT ZARQA | Hebrew cantillation Cantillation Cantillation is the ritual chanting of readings from the Hebrew Bible in synagogue services. The chants are written and notated in accordance with the special signs or marks printed in the Masoretic text of the Hebrew Bible to complement the letters and vowel points... mark |
ס֮ | U+05AE | HEBREW ACCENT ZINOR | Hebrew cantillation mark |
◌᷉ | U+1DC9 | COMBINING ACUTE-GRAVE-ACUTE | Used in IPA as a tone Tone (linguistics) Tone is the use of pitch in language to distinguish lexical or grammatical meaning—that is, to distinguish or inflect words. All verbal languages use pitch to express emotional and other paralinguistic information, and to convey emphasis, contrast, and other such features in what is called... mark |
⁓ | U+2053 | SWUNG DASH | |
∼ | U+223C | TILDE OPERATOR | Used in mathematics |
∽ | U+223D | REVERSED TILDE | In some fonts it is the tilde's simple mirror image Mirror image A mirror image is a reflected duplication of an object that appears identical but reversed. As an optical effect it results from reflection off of substances such as a mirror or water. It is also a concept in geometry and can be used as a conceptualization process for 3-D structures... ; others extend the tips to resemble a ∞ |
∿ | U+223F | SINE WAVE | |
≈ | U+2248 | ALMOST EQUAL TO | |
〜 | U+301C | WAVE DASH | Used in Japanese punctuation |
〰 | U+3030 | WAVY DASH | |
﹋ | U+FE4B | WAVY OVERLINE | |
﹏ | U+FE4F | WAVY LOW LINE | |
~ | U+FF5E | FULLWIDTH TILDE |
Range
In some languages (though not English), a tilde-like wavy dash may be used as punctuationPunctuation
Punctuation marks are symbols that indicate the structure and organization of written language, as well as intonation and pauses to be observed when reading aloud.In written English, punctuation is vital to disambiguate the meaning of sentences...
(instead of an unspaced hyphen
Hyphen
The hyphen is a punctuation mark used to join words and to separate syllables of a single word. The use of hyphens is called hyphenation. The hyphen should not be confused with dashes , which are longer and have different uses, or with the minus sign which is also longer...
or en-dash) between two number
Number
A number is a mathematical object used to count and measure. In mathematics, the definition of number has been extended over the years to include such numbers as zero, negative numbers, rational numbers, irrational numbers, and complex numbers....
s, to indicate a range
Interval (mathematics)
In mathematics, a interval is a set of real numbers with the property that any number that lies between two numbers in the set is also included in the set. For example, the set of all numbers satisfying is an interval which contains and , as well as all numbers between them...
rather than subtraction
Subtraction
In arithmetic, subtraction is one of the four basic binary operations; it is the inverse of addition, meaning that if we start with any number and add any number and then subtract the same number we added, we return to the number we started with...
or a hyphenated number (such as a part number or model number). For example, 12~15 means "12 to 15", ~3 means "up to three" and 100~ means "100 and greater". Japanese and other East Asian languages
East Asian languages
East Asian languages describe two notional groupings of languages in East and Southeast Asia:* Languages which have been greatly influenced by Classical Chinese and the Chinese writing system, in particular Chinese, Japanese, Korean, and Vietnamese .* The larger grouping of languages includes the...
almost always use this convention, but it is often done for clarity in some other languages as well. Chinese
Chinese language
The Chinese language is a language or language family consisting of varieties which are mutually intelligible to varying degrees. Originally the indigenous languages spoken by the Han Chinese in China, it forms one of the branches of Sino-Tibetan family of languages...
uses the wavy dash and full-width em dash interchangeably for this purpose. In English, the tilde is often used to express ranges and model numbers in electronics
Electronics
Electronics is the branch of science, engineering and technology that deals with electrical circuits involving active electrical components such as vacuum tubes, transistors, diodes and integrated circuits, and associated passive interconnection technologies...
but rarely in formal grammar or type-set documents, as a wavy dash preceding a number sometimes represents an approximation (see the Mathematics section, below).
Japanese
The is used for various purposes in Japanese, including to denote ranges of numbers, in place of dashes or brackets, and to indicate origin. The wave dash is also used to separate a title and a subtitle in the same line, as a colonColon (punctuation)
The colon is a punctuation mark consisting of two equally sized dots centered on the same vertical line.-Usage:A colon informs the reader that what follows the mark proves, explains, or lists elements of what preceded the mark....
is used in English.
When used in conversations via email or instant messenger it may be used as a sarcasm mark or, in East Asia, as an extension of the final syllable to produce the same effect as “whyyyyyy” with “why〜〜”. Used at the end of a word or sentence in text communications, it often denotes something said in a sing-song or playful voice, or similar to the use in instant messengers and email, depending on context. In some contexts, the tilde represents a lustful or exhausted sigh: "Hello there~."
Unicode and Shift JIS encoding of wave dash
In practice the (Unicode U+FF5E) is often used instead of the (Unicode U+301C), because the Shift JIS code for the wave dash, 0x8160, which is supposed to be mapped to U+301C, is not mapped to U+301C but mapped to U+FF5E in code page 932Code page 932
Code page 932 is Microsoft's extension of Shift JIS to include NEC special characters , NEC selection of IBM extensions , and IBM extensions . The coded character sets are JIS X0201:1997, JIS X0208:1997, and these extensions...
(Microsoft's code page
Code page
Code page is another term for character encoding. It consists of a table of values that describes the character set for a particular language. The term code page originated from IBM's EBCDIC-based mainframe systems, but many vendors use this term including Microsoft, SAP, and Oracle Corporation...
for Japanese), a widely-used extension of Shift JIS, in order to avoid the shape definition error in Unicode: the wave dash glyph in JIS/Shift JIS is identical to the Unicode reference glyph for U+FF5E, while the reference glyph for U+301C was incorrectly turned upside down when Unicode imported the JIS wave dash. In other platforms such as Mac OS and Mac OS X, 0x8160 is correctly mapped to U+301C. It is generally difficult, if not impossible, for Windows users in Japan to type U+301C, especially in legacy, non-Unicode applications.
Nevertheless, the Japanese wave dash is still formally mapped to U+301C as of JIS X 0213
JIS X 0213
JIS X 0213 is a Japanese Industrial Standard defining coded character sets for encoding the characters used in Japan. This standard extends JIS X 0208. The first version was published in 2000 and revised in 2004 . As well as adding a number of special characters, characters with diacritic marks,...
. Those two code points have the identical or very similar glyph in several fonts, reducing the confusion and incompatibility.
Mathematics
In mathematicsMathematics
Mathematics is the study of quantity, space, structure, and change. Mathematicians seek out patterns and formulate new conjectures. Mathematicians resolve the truth or falsity of conjectures by mathematical proofs, which are arguments sufficient to convince other mathematicians of their validity...
, the tilde operator (Unicode U+223C), sometimes called “twiddle”, is often used to denote an equivalence relation
Equivalence relation
In mathematics, an equivalence relation is a relation that, loosely speaking, partitions a set so that every element of the set is a member of one and only one cell of the partition. Two elements of the set are considered equivalent if and only if they are elements of the same cell...
between two objects. Thus “x ~ y” means “x is equivalent to y”. (Note that this is quite different from stating that x equals y.) The expression “x ~ y” is sometimes read aloud as “x twiddles y”, perhaps as an analogue to the verbal expression of “x = y”.
The tilde is also used as a modifier for symbols. The symbol “” is often pronounced “eff twiddle” or, particularly in American English, “eff wiggle”.
This can be used to denote the Fourier transform
Fourier transform
In mathematics, Fourier analysis is a subject area which grew from the study of Fourier series. The subject began with the study of the way general functions may be represented by sums of simpler trigonometric functions...
of f, or a lift
Lift (mathematics)
In the branch of mathematics called category theory, given a morphism f from an object X to an object Y, and a morphism g from an object Z to Y, a lift of f to Z is a morphism h from X to Z such that gh = f.A basic example in topology is lifting a path in one space to a path in a covering space...
of f, and can have a variety of other meanings depending on the context.
The tilde can indicate approximate equality in a variety of ways. It can be used to denote the asymptotic equality
Asymptotic analysis
In mathematical analysis, asymptotic analysis is a method of describing limiting behavior. The methodology has applications across science. Examples are...
of two functions. For example, f(x) ~ g(x), means that limx→∞ f(x)/g(x) = 1. A tilde is also used to indicate “approximately equal to” (e.g. 1.902 ~= 2). This usage probably developed as a typed alternative to the libra symbol used for the same purpose in written mathematics, which is an equal sign (=) with the upper bar replaced by a bar with an upward hump or loop in the middle or, sometimes, a tilde (≃). The symbol "≈" is also used for this purpose. Similarly, a tilde can be used on its own between two expressions (e.g. a ~ 0.1) to state that the two are of the same order of magnitude
Order of magnitude
An order of magnitude is the class of scale or magnitude of any amount, where each class contains values of a fixed ratio to the class preceding it. In its most common usage, the amount being scaled is 10 and the scale is the exponent being applied to this amount...
.
In statistics
Statistics
Statistics is the study of the collection, organization, analysis, and interpretation of data. It deals with all aspects of this, including the planning of data collection in terms of the design of surveys and experiments....
and probability theory
Probability theory
Probability theory is the branch of mathematics concerned with analysis of random phenomena. The central objects of probability theory are random variables, stochastic processes, and events: mathematical abstractions of non-deterministic events or measured quantities that may either be single...
, ⟨~⟩ means “is distributed as”. See random variable
Random variable
In probability and statistics, a random variable or stochastic variable is, roughly speaking, a variable whose value results from a measurement on some type of random process. Formally, it is a function from a probability space, typically to the real numbers, which is measurable functionmeasurable...
. A tilde placed on top of a variable is sometimes used to represent the median of that variable.
A tilde can also be used to represent geometric similarity
Similarity (geometry)
Two geometrical objects are called similar if they both have the same shape. More precisely, either one is congruent to the result of a uniform scaling of the other...
, for example: ∆ABC ~ ∆DEF (meaning "triangle
Triangle
A triangle is one of the basic shapes of geometry: a polygon with three corners or vertices and three sides or edges which are line segments. A triangle with vertices A, B, and C is denoted ....
ABC is similar to triangle DEF"). A triple tilde () is often used to show congruence
Congruence (geometry)
In geometry, two figures are congruent if they have the same shape and size. This means that either object can be repositioned so as to coincide precisely with the other object...
, an equivalence relation in geometry.
A tilde placed below a letter in mathematics can represent a vector quantity.
Logic
In written mathematical logicLogic
In philosophy, Logic is the formal systematic study of the principles of valid inference and correct reasoning. Logic is used in most intellectual activities, but is studied primarily in the disciplines of philosophy, mathematics, semantics, and computer science...
, the tilde represents negation
Negation
In logic and mathematics, negation, also called logical complement, is an operation on propositions, truth values, or semantic values more generally. Intuitively, the negation of a proposition is true when that proposition is false, and vice versa. In classical logic negation is normally identified...
: “~p” means “not p”, where "p" is a proposition
Proposition
In logic and philosophy, the term proposition refers to either the "content" or "meaning" of a meaningful declarative sentence or the pattern of symbols, marks, or sounds that make up a meaningful declarative sentence...
. Modern use has been replacing the tilde with the negation symbol (¬) for this purpose, to avoid confusion with equivalence relation
Equivalence relation
In mathematics, an equivalence relation is a relation that, loosely speaking, partitions a set so that every element of the set is a member of one and only one cell of the partition. Two elements of the set are considered equivalent if and only if they are elements of the same cell...
s.
Economics
For relations involving preference, economists sometimes use the tilde to represent indifference between two or more bundles of goods. For example, to say that a consumer is indifferent between bundles x and y, an economist would write x ~ y.Electronics
It can approximate the sine wave symbol ' onMouseout='HidePop("38735")' href="/topics/Unicode">U+Unicode
Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...
223F), which is used in electronics
Electronics
Electronics is the branch of science, engineering and technology that deals with electrical circuits involving active electrical components such as vacuum tubes, transistors, diodes and integrated circuits, and associated passive interconnection technologies...
to indicate alternating current
Alternating current
In alternating current the movement of electric charge periodically reverses direction. In direct current , the flow of electric charge is only in one direction....
, in place of +, −, or for direct current
Direct current
Direct current is the unidirectional flow of electric charge. Direct current is produced by such sources as batteries, thermocouples, solar cells, and commutator-type electric machines of the dynamo type. Direct current may flow in a conductor such as a wire, but can also flow through...
.
Directories and URLs
On UnixUnix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...
-like operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...
s (including BSD, GNU/Linux and Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...
), tilde often indicates the current user's home directory
Home directory
A Home directory is a file system directory on a multi-user operating system containing files for a given user of the system. The specifics of the home directory is defined by the operating system involved; for example, Windows systems between 2000 and 2003 keep home directories in a folder...
: for example, if the current user's home directory is /home/bloggsj, then cd, cd ~, cd /home/bloggsj or cd $HOME are equivalent. This practice derives from the Lear-Siegler ADM-3A
ADM-3A
The ADM-3A was one of the first computer terminals manufactured by Lear Siegler, first produced in 1975. It had a 12 inch screen displaying 12 or 24 lines of 80 characters.- Details :Originally priced at $1195, a DIY kit later sold for $995...
terminal in common use during the 1970s, which happened to have the tilde symbol and the word "Home" (for moving the cursor to the upper left) on the same key. When prepended to a particular username, the tilde indicates that user's home directory (e.g., ~janedoe for the home directory of user janedoe, such as /home/janedoe).
Used in URLs
Uniform Resource Locator
In computing, a uniform resource locator or universal resource locator is a specific character string that constitutes a reference to an Internet resource....
on the World Wide Web
World Wide Web
The World Wide Web is a system of interlinked hypertext documents accessed via the Internet...
, it often denotes a personal website on a Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...
-based server. For example,
In URLs, the characters %7E
Percent-encoding
Percent-encoding, also known as URL encoding, is a mechanism for encoding information in a Uniform Resource Identifier under certain circumstances. Although it is known as URL encoding it is, in fact, used more generally within the main Uniform Resource Identifier set, which includes both Uniform...
(or %7e) may substitute for tilde if an input device lacks a tilde key. Thus,
Computer languages
The tilde is used in the Awk programming languageProgramming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....
as part of the pattern match operators for regular expression
Regular expression
In computing, a regular expression provides a concise and flexible means for "matching" strings of text, such as particular characters, words, or patterns of characters. Abbreviations for "regular expression" include "regex" and "regexp"...
s:
variable ~ /regex/
returns true if the variable is matched.variable !~ /regex/
returns false if the variable is matched.
A variant of this, with the plain tilde replaced with
=~
, was adopted in PerlPerl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...
, and this semi-standardization has led to the use of these operators in other programming languages, such as Ruby or the SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....
variant of the database PostgreSQL
PostgreSQL
PostgreSQL, often simply Postgres, is an object-relational database management system available for many platforms including Linux, FreeBSD, Solaris, MS Windows and Mac OS X. It is released under the PostgreSQL License, which is an MIT-style license, and is thus free and open source software...
.
In APL and Matlab, tilde represents the monadic logical function NOT.
In the C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
, C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...
and C# programming languages, the tilde character is used as an operator
Operators in C and C++
This is a list of operators in the C and C++ programming languages. All the operators listed exist in C++; the fourth column "Included in C", dictates whether an operator is also present in C...
to invert all bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...
s of an integer
Integer
The integers are formed by the natural numbers together with the negatives of the non-zero natural numbers .They are known as Positive and Negative Integers respectively...
(bitwise NOT), following the notation in logic (an
!
causes a logical NOT, instead). In C++ and C#, the tilde is also used as the first character in a classClass (computer science)
In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior...
's method
Method (computer science)
In object-oriented programming, a method is a subroutine associated with a class. Methods define the behavior to be exhibited by instances of the associated class at program run time...
name (where the rest of the name must be the same name as the class) to indicate a destructor
Destructor (computer science)
In object-oriented programming, a destructor is a method which is automatically invoked when the object is destroyed...
– a special method which is called at the end of the object's life
Object lifetime
In computer science, the object lifetime of an object in object-oriented programming is the time between an object's creation till the object is no longer used, and is destructed or freed.In object-oriented programming , the meaning of creating objects is far more subtle than simple...
.
In the CSS
Cascading Style Sheets
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...
stylesheet language, the tilde is used for the indirect adjacent combinator as part of a selector.
In the D programming language, the tilde is used as an array concatenation
Concatenation
In computer programming, string concatenation is the operation of joining two character strings end-to-end. For example, the strings "snow" and "ball" may be concatenated to give "snowball"...
operator, as well as to indicate an object destructor and binary not operator. Tilde operator can be overloaded for user types, and binary tilde operator is mostly used to merging two objects, or adding some objects to set of objects. It was introduced because plus operator can have different meaning in many situations. For example what to do with "120" + "14" ? Is this a string "134" (addition of two numbers), or "12014" (concatenation of strings) or something else? D disallows + operator for arrays (and strings), and provides separate operator for concatenation (similarly PHP
PHP
PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...
programming language solved this problem by using dot operator for concatenation, and + for number addition, which will also work on strings containing numbers).
In Eiffel
Eiffel (programming language)
Eiffel is an ISO-standardized, object-oriented programming language designed by Bertrand Meyer and Eiffel Software. The design of the language is closely connected with the Eiffel programming method...
, the tilde is used for object comparison. If a and b denote objects, the boolean expression a ~ b has value true if an only if these objects are equal, as defined by the applicable version of the library routine is_equal, which by default denotes field-by-field object equality but can be redefined in any class to support a specific notion of equality. If a and b are references, the object equality expression a ~ b is to be contrasted with a = b which denotes reference equality. Unlike the call a.is_equal (b), the expression a ~ b is type-safe
Type safety
In computer science, type safety is the extent to which a programming language discourages or prevents type errors. A type error is erroneous or undesirable program behaviour caused by a discrepancy between differing data types...
even in the presence of covariance
Covariance and contravariance (computer science)
Within the type system of a programming language, covariance and contravariance refers to the ordering of types from narrower to wider and their interchangeability or equivalence in certain situations ....
.
In the Groovy programming language the tilde character is used as an operator mapped to the bitwiseNegate method. Given a String the method will produce a java.util.regex.Pattern. Given an integer it will negate the integer bitwise like in different C variants.
=~
and ~
can in Groovy be used to match a regular expression.In Haskell
Haskell (programming language)
Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry. In Haskell, "a function is a first-class citizen" of the programming language. As a functional programming language, the...
, the tilde is used in type constraints to indicate type equality; also, in pattern-matching patterns, the tilde makes a subpattern irrefutable.
In the Inform
Inform
Over the following decade, version 6 became reasonably stable and a popular language for writing interactive fiction. In 2006, Nelson released Inform 7 , a completely new language based on principles of natural language and a new set of tools based around a book-publishing metaphor.- Z-Machine and...
programming language, the tilde is used to indicate a quotation mark inside a quoted string.
In "text mode" of the LaTeX
LaTeX
LaTeX is a document markup language and document preparation system for the TeX typesetting program. Within the typesetting system, its name is styled as . The term LaTeX refers only to the language in which documents are written, not to the editor used to write those documents. In order to...
typesetting language a tilde diacritic can be obtained using, e.g.,
\~{n}
, yielding "ñ". A stand-alone tilde can be obtained by using \textasciitilde
or \string~
.In "math mode" a tilde diacritic can be written as, e.g.,
\tilde{x}
. For a wider tilde \widetilde
can be used. The \sim
command produce a tilde-like binary relation symbol that is often used in mathematical expressions, and the double-tilde is obtained with \approx
. The url
package also supports entering tildes directly, e.g., \url{http://server/~name}
.In both text and math mode, a tilde on its own (
~
) is rendering a white space with no line breaking.In Common Lisp
Common Lisp
Common Lisp, commonly abbreviated CL, is a dialect of the Lisp programming language, published in ANSI standard document ANSI INCITS 226-1994 , . From the ANSI Common Lisp standard the Common Lisp HyperSpec has been derived for use with web browsers...
, the tilde is used as the prefix for format specifiers in format strings.
In Max/MSP, a tilde is used to denote objects that process at the computer's sampling rate, i.e. mainly those that deal with sound.
In Standard ML
Standard ML
Standard ML is a general-purpose, modular, functional programming language with compile-time type checking and type inference. It is popular among compiler writers and programming language researchers, as well as in the development of theorem provers.SML is a modern descendant of the ML...
, the tilde is used as the prefix for negative numbers and as the unary negation operator.
In OCaml, the tilde is used to specify the label for a labeled parameter.
In Microsoft's SQL Server Transact-SQL (T-SQL)
Transact-SQL
Transact-SQL is Microsoft's and Sybase's proprietary extension to SQL. SQL, often expanded to Structured Query Language, is a standardized computer language that was originally developed by IBM for querying, altering and defining relational databases, using declarative statements...
language, the tilde is a unary Bitwise NOT operator.
Backup filenames
The dominant UnixUnix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...
convention for naming backup copies of files is appending a tilde to the original file name.
It originated with the Emacs
Emacs
Emacs is a class of text editors, usually characterized by their extensibility. GNU Emacs has over 1,000 commands. It also allows the user to combine these commands into macros to automate work.Development began in the mid-1970s and continues actively...
text editor and was adopted by many other editors and some command-line tools.
Emacs also introduced an elaborate numbered backup scheme, with files named filename.~1~, filename.~2~ and so on. It didn't catch on, probably because version control software does this better.
Microsoft filenames
The tilde was part of MicrosoftMicrosoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...
's filename mangling
Filename mangling
The process of filename mangling, in computing, involves a re-writing of the file name for compatibility at the operating system level. It occurs when a filename on a filesystem appears in a form incompatible with the operating system accessing it...
scheme when it developed the FAT
File Allocation Table
File Allocation Table is a computer file system architecture now widely used on many computer systems and most memory cards, such as those used with digital cameras. FAT file systems are commonly found on floppy disks, flash memory cards, digital cameras, and many other portable devices because of...
file system. This upgrade introduced long filenames to Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
, and permitted additional characters (such as the space) to be part of filenames, which were prohibited in previous versions. Programs written prior to this development could only access filenames in the so-called 8.3 format—the filenames consisted of a maximum of eight alphanumeric characters, followed by a period, followed by three more alphanumeric characters. In order to permit these legacy programs to access files in the FAT file system, each file had to be given two names—one long, more descriptive one, and one that conformed to the 8.3 format. This was accomplished with a name-mangling scheme in which the first six characters of the filename are followed by a tilde and a digit. For example, "Program Files" might become "PROGRA~1".
Also, the tilde symbol is used to prefix hidden temporary files that are created when a document is opened in Windows. For example, when you open a Word document called "Document1.doc," a file called "~$cument1.doc" is created in the same directory. This file contains information about which user has the file open, to prevent multiple users from attempting to change a document at the same time.
Games
In many games, the tilde key (on U.S. English keyboards) is used to open the console. This is true for games such as Half-Life, Halo CEHalo: Combat Evolved
Halo: Combat Evolved, frequently referred to as Halo: CE, or Halo 1, is a first-person shooter video game developed by Bungie and published by Microsoft Game Studios. The first game of the Halo franchise, it was released on November 15, 2001 as a launch title for the Xbox gaming system, and is...
, Quake, Half-Life 2
Half-Life 2
Half-Life 2 , the sequel to Half-Life, is a first-person shooter video game and a signature title in the Half-Life series. It is singleplayer, story-driven, science fiction, and linear...
, Soldier of Fortune II: Double Helix
Soldier of Fortune II: Double Helix
Soldier of Fortune II: Double Helix is a video game created by Raven Software, a sequel to Soldier of Fortune. It was developed using the Quake III: Team Arena engine. Once again, Raven hired John Mullins to act as a consultant on the game...
, Unreal
Unreal
Unreal is a first-person shooter video game developed by Epic MegaGames and Digital Extremes and published by GT Interactive in May 1998...
, Counter-Strike
Counter-Strike
Counter-Strike is a tactical first-person shooter video game developed by Valve Corporation which originated from a Half-Life modification by Minh "Gooseman" Le and Jess "Cliffe" Cliffe...
, Crysis
Crysis
Crysis is a science fiction first-person shooter video game developed by Crytek , published by Electronic Arts for Microsoft Windows, and released in November 2007. It is the first game of a trilogy. A separate game entitled Crysis Warhead was released on September 12, 2008, and follows similar...
, Oblivion
The Elder Scrolls IV: Oblivion
The Elder Scrolls IV: Oblivion is a single-player action role-playing video game developed by Bethesda Game Studios and published by Bethesda Softworks and the Take-Two Interactive subsidiary 2K Games...
, RuneScape
RuneScape
RuneScape is a fantasy massively multiplayer online role-playing game released in January 2001 by Andrew and Paul Gower, and developed and published by Jagex Games Studio. It is a graphical browser game implemented on the client-side in Java, and incorporates 3D rendering...
, and others based on the Quake engine
Quake engine
The Quake engine is the game engine that was written to power 1996's Quake, written by id Software. It featured true 3D real-time rendering and is now licensed under the terms of the GNU General Public License ....
or Source engine.
It is sometimes used in Rogue-like games to represent water or snakes.
Other uses
Computer programmers use the tilde in various ways and sometimes call the symbol (as opposed to the diacritic) a squiggle, squiggly, or twiddle. According to the Jargon FileJargon File
The Jargon File is a glossary of computer programmer slang. The original Jargon File was a collection of terms from technical cultures such as the MIT AI Lab, the Stanford AI Lab and others of the old ARPANET AI/LISP/PDP-10 communities, including Bolt, Beranek and Newman, Carnegie Mellon...
, other synonyms sometimes used in programming include not, approx, wiggle, enyay (after eñe
Ñ
Ñ is a letter of the modern Latin alphabet, formed by an N with a diacritical tilde. It is used in the Spanish alphabet, Galician alphabet, Asturian alphabet, Basque alphabet, Aragonese old alphabet , Filipino alphabet, Chamorro alphabet and the Guarani alphabet, where it represents...
) and (humorously) sqiggle (ˈ).
In Perl 6
Perl 6
Perl 6 is a major revision to the Perl programming language. It is still in development, as a specification from which several interpreter and compiler implementations are being written. It is introducing elements of many modern and historical languages. Perl 6 is intended to have many...
, "
Juggling notation
In the juggling notationJuggling NotationJuggling notation is the written depiction of concepts and practices in juggling. Toss juggling patterns have a reputation for being "easier done than said" – while it might be easy to learn a given maneuver and demonstrate it for others, it is often much harder to communicate the idea accurately...
system Beatmap, tilde can be added to either "hand" in a pair of fields to say "cross the arms with this hand on top". Mills MessMills MessIn juggling, the Mills Mess is a popular toss juggling pattern, typically performed with three balls although the number and objects can be different...
is thus represented as (~2x,1)(1,2x)(2x,~1)*.
KeyboardsWhere a tilde is on the keyboard depends on the computer's language settings according to the following chart. On many keyboards it is primarily available through a dead key
Dead key
A dead key is a special kind of a modifier key on a typewriter or computer keyboard that is typically used to attach a specific diacritic to a base letter. The dead key does not generate a character by itself but modifies the character generated by the key struck immediately after...
that makes it possible to produce a variety of precomposed character
Precomposed character
A precomposed character is a Unicode entity that can be defined as a combination of two or more other characters. A precomposed character may typically represent a letter with a diacritical mark, such as é...
s with the diacritic. In that case, a single tilde can typically be inserted with the dead key followed by the space bar, or alternatively by striking the dead key twice in a row.
To insert a tilde with the dead key, it is often necessary to simultaneously hold down the Alt Gr key. On the keyboard layouts that include an Alt Gr key, it typically takes the place of the right-hand Alt key
Alt key
The Alt key on a computer keyboard is used to change the function of other pressed keys. Thus, the Alt key is a modifier key, used in a similar fashion to the Shift key. For example, simply pressing "A" will type the letter a, but if you hold down either Alt key while pressing A, the computer...
. With a Macintosh
Macintosh
The Macintosh , or Mac, is a series of several lines of personal computers designed, developed, and marketed by Apple Inc. The first Macintosh was introduced by Apple's then-chairman Steve Jobs on January 24, 1984; it was the first commercially successful personal computer to feature a mouse and a...
either of the Alt/Option
Option key
The Option key is a modifier key present on Apple keyboards. It is located between the Control key and Command key on a typical Mac keyboard. There are two option keys on modern Mac desktop and notebook keyboards, one on each side of the space bar....
keys function similarly.
In the US and European Windows systems, the Alt code for a single tilde is
126
.Keyboard | Insert a single tilde (~) | Insert a precomposed character with tilde (e.g. ã) |
---|---|---|
Arabic (Saudi) | ||
Croatian Croatian language Croatian is the collective name for the standard language and dialects spoken by Croats, principally in Croatia, Bosnia and Herzegovina, the Serbian province of Vojvodina and other neighbouring countries... |
+ | |
Dvorak Dvorak Simplified Keyboard The Dvorak Simplified Keyboard is a keyboard layout patented in 1936 by Dr. August Dvorak and his brother-in-law, Dr. William Dealey. Over the years several slight variations were designed by the team led by Dvorak or by ANSI... |
followed by , or followed by |
followed by the relevant letter, or followed by the relevant letter |
English English language English is a West Germanic language that arose in the Anglo-Saxon kingdoms of England and spread into what was to become south-east Scotland under the influence of the Anglian medieval kingdom of Northumbria... (Australia Australia Australia , officially the Commonwealth of Australia, is a country in the Southern Hemisphere comprising the mainland of the Australian continent, the island of Tasmania, and numerous smaller islands in the Indian and Pacific Oceans. It is the world's sixth-largest country by total area... ) |
||
English (Canada Canada Canada is a North American country consisting of ten provinces and three territories. Located in the northern part of the continent, it extends from the Atlantic Ocean in the east to the Pacific Ocean in the west, and northward into the Arctic Ocean... ) |
||
English (UK United Kingdom The United Kingdom of Great Britain and Northern IrelandIn the United Kingdom and Dependencies, other languages have been officially recognised as legitimate autochthonous languages under the European Charter for Regional or Minority Languages... ) |
||
English (US United States The United States of America is a federal constitutional republic comprising fifty states and a federal district... ) |
followed by the relevant letter | |
Finnish Finnish language Finnish is the language spoken by the majority of the population in Finland Primarily for use by restaurant menus and by ethnic Finns outside Finland. It is one of the two official languages of Finland and an official minority language in Sweden. In Sweden, both standard Finnish and Meänkieli, a... |
followed by , or |
followed by the relevant letter |
French French language French is a Romance language spoken as a first language in France, the Romandy region in Switzerland, Wallonia and Brussels in Belgium, Monaco, the regions of Quebec and Acadia in Canada, and by various communities elsewhere. Second-language speakers of French are distributed throughout many parts... (Canada Canada Canada is a North American country consisting of ten provinces and three territories. Located in the northern part of the continent, it extends from the Atlantic Ocean in the east to the Pacific Ocean in the west, and northward into the Arctic Ocean... ) |
followed by , or |
followed by the relevant letter |
French (France France The French Republic , The French Republic , The French Republic , (commonly known as France , is a unitary semi-presidential republic in Western Europe with several overseas territories and islands located on other continents and in the Indian, Pacific, and Atlantic oceans. Metropolitan France... ) |
followed by , or |
followed by the relevant letter |
French (Switzerland Switzerland Switzerland name of one of the Swiss cantons. ; ; ; or ), in its full name the Swiss Confederation , is a federal republic consisting of 26 cantons, with Bern as the seat of the federal authorities. The country is situated in Western Europe,Or Central Europe depending on the definition.... ) |
followed by , or |
followed by the relevant letter |
German German language German is a West Germanic language, related to and classified alongside English and Dutch. With an estimated 90 – 98 million native speakers, German is one of the world's major languages and is the most widely-spoken first language in the European Union.... (Germany Germany Germany , officially the Federal Republic of Germany , is a federal parliamentary republic in Europe. The country consists of 16 states while the capital and largest city is Berlin. Germany covers an area of 357,021 km2 and has a largely temperate seasonal climate... ) |
||
German (Switzerland Switzerland Switzerland name of one of the Swiss cantons. ; ; ; or ), in its full name the Swiss Confederation , is a federal republic consisting of 26 cantons, with Bern as the seat of the federal authorities. The country is situated in Western Europe,Or Central Europe depending on the definition.... ) |
followed by , or |
followed by the relevant letter |
Hindi Hindi Standard Hindi, or more precisely Modern Standard Hindi, also known as Manak Hindi , High Hindi, Nagari Hindi, and Literary Hindi, is a standardized and sanskritized register of the Hindustani language derived from the Khariboli dialect of Delhi... (India India India , officially the Republic of India , is a country in South Asia. It is the seventh-largest country by geographical area, the second-most populous country with over 1.2 billion people, and the most populous democracy in the world... ) |
+ the key to the left of | |
Hungarian Hungarian language Hungarian is a Uralic language, part of the Ugric group. With some 14 million speakers, it is one of the most widely spoken non-Indo-European languages in Europe.... |
+ | |
Icelandic Icelandic language Icelandic is a North Germanic language, the main language of Iceland. Its closest relative is Faroese.Icelandic is an Indo-European language belonging to the North Germanic or Nordic branch of the Germanic languages. Historically, it was the westernmost of the Indo-European languages prior to the... |
(the same key as ) | |
Italian Italian language Italian is a Romance language spoken mainly in Europe: Italy, Switzerland, San Marino, Vatican City, by minorities in Malta, Monaco, Croatia, Slovenia, France, Libya, Eritrea, and Somalia, and by immigrant communities in the Americas and Australia... |
(on Mac OS X) | |
Norwegian Norwegian language Norwegian is a North Germanic language spoken primarily in Norway, where it is the official language. Together with Swedish and Danish, Norwegian forms a continuum of more or less mutually intelligible local and regional variants .These Scandinavian languages together with the Faroese language... |
followed by , or |
followed by the relevant letter |
Polish Polish language Polish is a language of the Lechitic subgroup of West Slavic languages, used throughout Poland and by Polish minorities in other countries... |
followed by , or |
{a>c|e|l|n|o|s|x|z}, it results in |
Portuguese Portuguese language Portuguese is a Romance language that arose in the medieval Kingdom of Galicia, nowadays Galicia and Northern Portugal. The southern part of the Kingdom of Galicia became independent as the County of Portugal in 1095... |
followed by | followed by the relevant letter |
Spanish Spanish language Spanish , also known as Castilian , is a Romance language in the Ibero-Romance group that evolved from several languages and dialects in central-northern Iberia around the 9th century and gradually spread with the expansion of the Kingdom of Castile into central and southern Iberia during the... (Spain Spain Spain , officially the Kingdom of Spain languages]] under the European Charter for Regional or Minority Languages. In each of these, Spain's official name is as follows:;;;;;;), is a country and member state of the European Union located in southwestern Europe on the Iberian Peninsula... ) |
followed by , or |
followed by the relevant letter |
Spanish Spanish language Spanish , also known as Castilian , is a Romance language in the Ibero-Romance group that evolved from several languages and dialects in central-northern Iberia around the 9th century and gradually spread with the expansion of the Kingdom of Castile into central and southern Iberia during the... (Latin America Latin America Latin America is a region of the Americas where Romance languages – particularly Spanish and Portuguese, and variably French – are primarily spoken. Latin America has an area of approximately 21,069,500 km² , almost 3.9% of the Earth's surface or 14.1% of its land surface area... ) |
||
Swedish Swedish language Swedish is a North Germanic language, spoken by approximately 10 million people, predominantly in Sweden and parts of Finland, especially along its coast and on the Åland islands. It is largely mutually intelligible with Norwegian and Danish... |
followed by , or |
followed by the relevant letter |
Turkish Turkish language Turkish is a language spoken as a native language by over 83 million people worldwide, making it the most commonly spoken of the Turkic languages. Its speakers are located predominantly in Turkey and Northern Cyprus with smaller groups in Iraq, Greece, Bulgaria, the Republic of Macedonia, Kosovo,... |
followed by , or |
followed by the relevant letter |
External links