Vertical bar

# Vertical bar

Discussion

Encyclopedia
The vertical bar is a character with various uses in mathematics, where it can be used to represent absolute value
Absolute value
In mathematics, the absolute value |a| of a real number a is the numerical value of a without regard to its sign. So, for example, the absolute value of 3 is 3, and the absolute value of -3 is also 3...

, among others; in computing and programming and in general typography, as a divider not unlike the interpunct
Interpunct
An interpunct —also called an interpoint—is a small dot used for interword separation in ancient Latin script, which also appears in some modern languages as a stand-alone sign inside a word. It is present in Unicode as code point ....

. It may be called by various other names including the pipe (by the 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...

community, referring to the I/O pipeline
Pipeline (Unix)
In Unix-like computer operating systems , a pipeline is the original software pipeline: a set of processes chained by their standard streams, so that the output of each process feeds directly as input to the next one. Each connection is implemented by an anonymous pipe...

construct), Sheffer stroke
Sheffer stroke
In Boolean functions and propositional calculus, the Sheffer stroke, named after Henry M. Sheffer, written "|" , "Dpq", or "↑", denotes a logical operation that is equivalent to the negation of the conjunction operation, expressed in ordinary language as "not both"...

(by computer or mathematic logicians
History of logic
The history of logic is the study of the development of the science of valid inference . Formal logic was developed in ancient times in China, India, and Greece...

), verti-bar, vbar, stick, vertical line, vertical slash, or bar, think colon, poley or divider line or polon by others.

The broken bar (¦), also termed "parted rule" in Unicode documentation, is a separate character, but due to historical confusion between the two, computer keyboards and displays may not clearly or consistently differentiate them. The typical keyboard layout
Keyboard layout
A keyboard layout is any specific mechanical, visual, or functional arrangement of the keys, legends, or key–meaning associations of a computer, typewriter, or other typographic keyboard....

used in the United Kingdom
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...

features separate keys for vertical bar and broken bar; however, typically on 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...

PCs the vertical bar key produces a broken-bar symbol. North American keyboards typically have a key bearing a broken-bar symbol, which produces a vertical bar. In the default console font on Windows systems, the glyph used for the vertical bar character formerly looked exactly like a broken bar (but this is no longer the case on Windows 7).

The broken bar does not appear to have any clearly identified uses distinct from the vertical bar. The examples in this article all use the vertical bar, but in actual use in some computing environments (for example, in use as a DOS pipe character), a broken bar may be displayed instead. In non-computing use — for example in mathematics, physics and general typography — the broken bar is not an acceptable substitute for the vertical bar.

### Mathematics

The vertical bar is used as a mathematical symbol
Table of mathematical symbols
This is a listing of common symbols found within all branches of mathematics. Each symbol is listed in both HTML, which depends on appropriate fonts being installed, and in , as an image.-Symbols:-Variations:...

in
• absolute value
Absolute value
In mathematics, the absolute value |a| of a real number a is the numerical value of a without regard to its sign. So, for example, the absolute value of 3 is 3, and the absolute value of -3 is also 3...

: , read "the absolute value of x
X
X is the twenty-fourth letter in the basic modern Latin alphabet.-Uses:In mathematics, x is commonly used as the name for an independent variable or unknown value. The usage of x to represent an independent or unknown variable can be traced back to the Arabic word šay شيء = “thing,” used in Arabic...

"
.
• norm
Norm (mathematics)
In linear algebra, functional analysis and related areas of mathematics, a norm is a function that assigns a strictly positive length or size to all vectors in a vector space, other than the zero vector...

s: , read "the norm of x sub one, x sub two"; though Unicode also provides a special double vertical line symbol U+2016:
• Parallelism
Parallel (geometry)
Parallelism is a term in geometry and in everyday life that refers to a property in Euclidean space of two or more lines or planes, or a combination of these. The assumed existence and properties of parallel lines are the basis of Euclid's parallel postulate. Two lines in a plane that do not...

in geometry
Geometry
Geometry arose as the field of knowledge dealing with spatial relationships. Geometry was one of the two fields of pre-modern mathematics, the other being the study of numbers ....

, where indicates that the line is parallel to the line .
• set-builder notation
Set-builder notation
In set theory and its applications to logic, mathematics, and computer science, set-builder notation is a mathematical notation for describing a set by stating the properties that its members must satisfy...

: , read "the set of x such that x is less than two". Often a colon
Colon (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 instead of a vertical bar.
• cardinality: , read "the cardinality of the set S".
• conditional probability
Conditional probability
In probability theory, the "conditional probability of A given B" is the probability of A if B is known to occur. It is commonly notated P, and sometimes P_B. P can be visualised as the probability of event A when the sample space is restricted to event B...

Probability
Probability is ordinarily used to describe an attitude of mind towards some proposition of whose truth we arenot certain. The proposition of interest is usually of the form "Will a specific event occur?" The attitude of mind is of the form "How certain are we that the event will occur?" The...

of X given Y"
.
• divisibility: , read "a divides b", though Unicode also provides special ‘divides’ and ‘does not divide’ symbols (U+2223 and U+2224: )
• the Sheffer stroke
Sheffer stroke
In Boolean functions and propositional calculus, the Sheffer stroke, named after Henry M. Sheffer, written "|" , "Dpq", or "↑", denotes a logical operation that is equivalent to the negation of the conjunction operation, expressed in ordinary language as "not both"...

in logic
Logic
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...

: , read "a nand b".
• evaluate: , read "a plus 3 evaluated for when a equals 4", or .
• distance
Distance
Distance is a numerical description of how far apart objects are. In physics or everyday discussion, distance may refer to a physical length, or an estimation based on other criteria . In mathematics, a distance function or metric is a generalization of the concept of physical distance...

: distance notes the shortest distance between dot to line , so is perpendicular to line .
• evaluate (subscript notation): , read "f of x evaluated at x equals 4" (see subscripts at Wikibooks)
• restriction: denotes a restriction of function where it is defined over a domain which is a superset of .
• Sometimes a vertical bar following a function, with sub- and super-script limits 'a' and 'b' is used when evaluating definite integrals to mean 'f(x) from a to b', or 'f(b)-f(a)'.

### Physics

The vertical bar is used in bra-ket notation
Bra-ket notation
Bra-ket notation is a standard notation for describing quantum states in the theory of quantum mechanics composed of angle brackets and vertical bars. It can also be used to denote abstract vectors and linear functionals in mathematics...

in quantum physics. Examples:
• — The quantum mechanical state "".
• — The dual state
Dual space
In mathematics, any vector space, V, has a corresponding dual vector space consisting of all linear functionals on V. Dual vector spaces defined on finite-dimensional vector spaces can be used for defining tensors which are studied in tensor algebra...

corresponding to the state above.
• — The inner product of states and .

#### Pipe

A pipe is an inter-process communication
Inter-process communication
In computing, Inter-process communication is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared...

mechanism originating in 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...

which allows the output (standard out and, optionally, standard error) of one process to be used as input (standard in) to another. In this way, a series of commands can be "piped" together, giving users the ability to quickly perform complex multi-stage processing from the command line or as part of a Unix shell script ("batch file"). In most Unix shell
Unix shell
A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems...

s (command interpreters), this is represented by the vertical bar character. For example:
egrep -i 'blair' filename.log | more

where the output from the "egrep" process is piped to the "more" process.

The same "pipe" feature is also found in later versions of DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

and Microsoft Windows.

#### Disjunction

In many programming languages, the vertical bar is used to designate the logic operation or
Logical disjunction
In logic and mathematics, a two-place logical connective or, is a logical disjunction, also known as inclusive disjunction or alternation, that results in true whenever one or more of its operands are true. E.g. in this context, "A or B" is true if A is true, or if B is true, or if both A and B are...

, either bitwise
Bitwise operation
A bitwise operation operates on one or more bit patterns or binary numerals at the level of their individual bits. This is used directly at the digital hardware level as well as in microcode, machine code and certain kinds of high level languages...

or or logical
Boolean datatype
In computer science, the Boolean or logical data type is a data type, having two values , intended to represent the truth values of logic and Boolean algebra...

or.

Specifically, in 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....

and other languages following C syntax conventions, such as 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...

, Perl
Perl
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...

, Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

and C#, `(a | b)` denotes a bitwise or; whilst a double vertical bar `(a || b)` denotes a (short-circuited
Minimal evaluation
Short-circuit evaluation, minimal evaluation, or McCarthy evaluation denotes the semantics of some Boolean operators in some programming languages in which the second argument is only executed or evaluated if the first argument does not suffice to determine the value of the expression: when the...

) logical or
Logical disjunction
In logic and mathematics, a two-place logical connective or, is a logical disjunction, also known as inclusive disjunction or alternation, that results in true whenever one or more of its operands are true. E.g. in this context, "A or B" is true if A is true, or if B is true, or if both A and B are...

.

In 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"...

syntax, the vertical bar again indicates logical or. For example: the Unix command grep
Grep
grep is a command-line text-search utility originally written for Unix. The name comes from the ed command g/re/p...

-E 'foo|bar'
matches lines containing 'foo' or 'bar'.

#### Concatenation

In PL/I
PL/I
PL/I is a procedural, imperative computer programming language designed for scientific, engineering, business and systems programming applications...

and certain dialects
Programming language dialect
A dialect of a programming language is a variation or extension of the language that does not change its intrinsic nature. With languages such as Scheme and Forth, standards may be considered insufficient, inadequate or even illegitimate by implementors, so often they will deviate from the...

of SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....

, the operator "||" denotes string
String (computer science)
In formal languages, which are used in mathematical logic and theoretical computer science, a string is a finite sequence of symbols that are chosen from a set or alphabet....

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"...

.

#### Delimiter

Although not as common as commas or tabs, the vertical bar can be used as a delimiter
Delimiter
A delimiter is a sequence of one or more characters used to specify the boundary between separate, independent regions in plain text or other data streams. An example of a delimiter is the comma character, which acts as a field delimiter in a sequence of comma-separated values.Delimiters represent...

in a flat file. An example of a pipe-delimited standard data format is LEDES 1998B. It is frequently used because vertical bar is typically uncommon in the data itself.

#### Backus-Naur form

In Backus-Naur form, an expression consists of sequences of symbols and/or sequences separated by '|', indicating a choice, the whole being a possible substitution for the symbol on the left.
::= |

#### Concurrency operator

In calculi of communicating processes (like pi-calculus
Pi-calculus
In theoretical computer science, the π-calculus is a process calculus originally developed by Robin Milner, and David Walker as a continuation of work on the process calculus CCS...

), the vertical bar is used to indicate that processes execute in parallel.

#### List comprehensions

The vertical bar is used for list comprehensions in some functional languages, e. g. Haskell
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...

and Erlang. Compare set-builder notation.

### Phonetics and orthography

In the Khoisan languages
Khoisan languages
The Khoisan languages are the click languages of Africa which do not belong to other language families. They include languages indigenous to southern and eastern Africa, though some, such as the Khoi languages, appear to have moved to their current locations not long before the Bantu expansion...

and the International Phonetic Alphabet
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...

, the vertical bar is used to write the dental click
Dental click
Dental clicks are a family of click consonants found, as constituents of words, only in Africa and in the Damin ritual jargon of Australia. The tut-tut! or tsk! tsk! sound used to express disapproval or pity is a dental click, although it isn't a speech sound in that context.The symbol in the...

(ǀ). A double vertical bar is used to write the alveolar lateral click (ǁ). Since these are technically letters, they have their own Unicode
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...

code points in the Latin Extended-B range: U+01C0 for the single bar and U+01C1 for the double bar. Longer single and double vertical bars are used to mark prosodic
Prosody (linguistics)
In linguistics, prosody is the rhythm, stress, and intonation of speech. Prosody may reflect various features of the speaker or the utterance: the emotional state of the speaker; the form of the utterance ; the presence of irony or sarcasm; emphasis, contrast, and focus; or other elements of...

boundaries in the IPA.

## Encoding

The vertical bar ("|") is at position 124 (decimal) in the ASCII
ASCII
The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

character set. The broken bar ("¦") is not part of ASCII but is a separate character that appeared (along with vertical bar) first in the EBCDIC
EBCDIC
Extended Binary Coded Decimal Interchange Code is an 8-bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems....

family of character sets, and was copied from there into ISO 8859-1 and Unicode
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...

.

The typical computer keyboard used in the United Kingdom features separate keys for "vertical bar" and "broken bar", even though "broken bar" has hardly any practical application. Some keyboard drivers map the broken bar key to the vertical bar, and the vertical bar key, shared with the grave accent (`), generates the broken bar when pressed in combination with AltGr.

### In common character maps

>') Broken bar ('¦')
ASCII
ASCII
The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

decimal (base-10): 124
N/A
ISO/IEC 8859-1
ISO/IEC 8859-1
ISO/IEC 8859-1:1998, Information technology — 8-bit single-byte coded graphic character sets — Part 1: Latin alphabet No. 1, is part of the ISO/IEC 8859 series of ASCII-based standard character encodings, first edition published in 1987. It is informally referred to as Latin-1. It is generally...

Unicode
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...

U+007C U+00A6
EBCDIC
EBCDIC
Extended Binary Coded Decimal Interchange Code is an 8-bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems....

(CCSID 500
EBCDIC 500
IBM code page 500 is an EBCDIC code page with full Latin-1-charset used in IBM mainframes.CCSID 1148 is the Euro currency update of code page/CCSID 500. Byte 9F is replaced ¤ with € in that code page.-Codepage layout:...

variant)
Shift-JIS
Shift-JIS
Shift JIS is a character encoding for the Japanese language originally developed by a Japanese company called ASCII Corporation in conjunction with Microsoft and standardized as JIS X 0208 Appendix 1...

Men-Ku-Ten
1-01-35

• Double vertical line ('‖'): U+2016
• Latin letter dental click : U+01C0
• Latin letter lateral click : U+01C1
• Symbol 'divides' : U+2223
• Various Box-drawing characters at U+2500 to U+257F

### In text processing

In 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...

, the vertical bar can be used as delimiter in mathematical mode. The sequence \| creates a double vertical line (a | b \| c is set as ). In LaTeX text mode, the vertical bar produces an em dash (—), or you can use the \textbar command instead.

The vertical bar is also used as special character in other Lightweight markup language
Lightweight markup language
A lightweight markup language is a markup language with a simple syntax, designed to be easy for a human to enter with a simple text editor, and easy to read in its raw form....

s, notably Wikipedia's own Wikitext
Wikitext
Wikitext language, or wiki markup, is a lightweight markup language used to write pages in wiki websites, such as Wikipedia, and is a simplified alternative/intermediate to HTML. Its ultimate purpose is to be converted by wiki software into HTML, which in turn is served to web browsers.There is no...

.