vertical bar
   HOME

TheInfoList



OR:

The vertical bar, , is a
glyph A glyph ( ) is any kind of purposeful mark. In typography, a glyph is "the specific shape, design, or representation of a character". It is a particular graphical representation, in a particular typeface, of an element of written language. A ...
with various uses in
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
,
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, and
typography Typography is the art and technique of Typesetting, arranging type to make written language legibility, legible, readability, readable and beauty, appealing when displayed. The arrangement of type involves selecting typefaces, Point (typogra ...
. It has many names, often related to particular meanings: Sheffer stroke (in
logic Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the study of deductively valid inferences or logical truths. It examines how conclusions follow from premises based on the structure o ...
), pipe, bar, or (literally, the word "or"), vbar, and others.


Usage


Mathematics

The vertical bar is used as a mathematical symbol in numerous ways. If used as a pair of brackets, it suggests the notion of the word "size". These are: *
absolute value In mathematics, the absolute value or modulus of a real number x, is the non-negative value without regard to its sign. Namely, , x, =x if x is a positive number, and , x, =-x if x is negative (in which case negating x makes -x positive), ...
: , x, , read "the ''absolute value'' of ''x''" *
cardinality The thumb is the first digit of the hand, next to the index finger. When a person is standing in the medical anatomical position (where the palm is facing to the front), the thumb is the outermost digit. The Medical Latin English noun for thum ...
: , S, , read "the ''cardinality'' of the set ''S''" or "the ''length'' of a string ''S''" *
determinant In mathematics, the determinant is a Scalar (mathematics), scalar-valued function (mathematics), function of the entries of a square matrix. The determinant of a matrix is commonly denoted , , or . Its value characterizes some properties of the ...
: , A, , read "the ''determinant'' of the matrix ''A''". When the matrix entries are written out, the determinant is denoted by surrounding the matrix entries by vertical bars instead of the usual brackets or parentheses of the matrix, as in \begin a & b \\ c & d\end. * order: , G, , read "the ''order'' of the group ''G''", or , g, , "the ''order'' of the element g \in G" Likewise, the vertical bar is also used singly in many different ways: *
conditional probability In probability theory, conditional probability is a measure of the probability of an Event (probability theory), event occurring, given that another event (by assumption, presumption, assertion or evidence) is already known to have occurred. This ...
: P(X, Y), read "the
probability Probability is a branch of mathematics and statistics concerning events and numerical descriptions of how likely they are to occur. The probability of an event is a number between 0 and 1; the larger the probability, the more likely an e ...
of ''X'' ''given'' ''Y''" *
distance Distance is a numerical or occasionally qualitative measurement of how far apart objects, points, people, or ideas are. In physics or everyday usage, distance may refer to a physical length or an estimation based on other criteria (e.g. "two co ...
: P, ab, denoting the shortest ''distance'' between point P to line ab, so line P, ab is perpendicular to line ab *
divisibility In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a ''Multiple (mathematics), multiple'' of m. An integer n is divis ...
: a \mid b, read "''a'' ''divides'' ''b''" or "''a'' is a ''factor'' of ''b''", though Unicode also provides special 'divides' and 'does not divide' symbols ( and ) * function evaluation: f(x), _, read "''f'' of ''x'', evaluated at ''x'' equals 4" (see subscripts at Wikibooks) * restriction: f, _, denoting the ''restriction'' of the function f, with a domain that is a superset of A, to just A * set-builder notation: \, read "the set of ''x'' ''such that'' ''x'' is
less than In mathematics, an inequality is a relation which makes a non-equal comparison between two numbers or other mathematical expressions. It is used most often to compare two numbers on the number line by their size. The main types of inequality ar ...
two". Often, a colon ':' is used instead of a vertical bar * the Sheffer stroke in
logic Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the study of deductively valid inferences or logical truths. It examines how conclusions follow from premises based on the structure o ...
: a, b, read "''a'' ''nand'' ''b''" * subtraction: f(x) \vert _a ^b, read "''f(x)'' ''from'' ''a'' ''to'' ''b''", denoting f(b) - f(a). Used in the context of a definite integral with variable ''x''. * A vertical bar can be used to separate variables from fixed parameters in a function, for example f(x, \mu,\sigma), or in the notation for elliptic integrals. The double vertical bar, \, , is also employed in mathematics. * parallelism: AB \parallel CD, read "the line AB ''is parallel to'' the line CD" * norm: \, A\, , read "the ''norm'' (length, size, magnitude etc.) of the matrix A". The norm of a one-dimensional vector is the absolute value and single bars are used. * Propositional truncation: (a type former that truncates a type down to a mere proposition in homotopy type theory): for any a : A (read "term a of type A") we have , a, : \left\, A \right\, (here , a, reads "''
image An image or picture is a visual representation. An image can be Two-dimensional space, two-dimensional, such as a drawing, painting, or photograph, or Three-dimensional space, three-dimensional, such as a carving or sculpture. Images may be di ...
'' of a : A in \left\, A \right\, " and , a, : \left\, A \right\, reads "''propositional truncation'' of A") In LaTeX mathematical mode, the ASCII vertical bar produces a vertical line, and \, creates a double vertical line (a , b \, c is set as a , b \, c). This has different spacing from \mid and \parallel, which are relational operators: a \mid b \parallel c is set as a \mid b \parallel c. See below about
LaTeX Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latices are found in nature, but synthetic latices are common as well. In nature, latex is found as a wikt:milky, milky fluid, which is present in 10% of all floweri ...
in text mode.


Chemistry

In chemistry, the vertical line is used in cell notation of electrochemical cells. Example, Zn , Zn2+ , , Cu2+ , Cu Single vertical lines show components of the cell which do not mix, usually being in different phases. The double vertical line ( , , ) is used to represent salt bridge; which is used to allow free moving ions to move.


Physics

The vertical bar is used in
bra–ket notation Bra–ket notation, also called Dirac notation, is a notation for linear algebra and linear operators on complex vector spaces together with their dual space both in the finite-dimensional and infinite-dimensional case. It is specifically de ...
in
quantum physics Quantum mechanics is the fundamental physical Scientific theory, theory that describes the behavior of matter and of light; its unusual characteristics typically occur at and below the scale of atoms. Reprinted, Addison-Wesley, 1989, It is ...
. Examples: * , \psi\rangle: the quantum physical state \psi * \langle\psi, : the dual state corresponding to the state above * \langle\psi, \rho\rangle: the inner product of states \psi and \rho * Supergroups in physics are denoted ''G''(''N'', ''M''), which reads "''G'', ''M'' vertical bar ''N''"; here ''G'' denotes any supergroup, ''M'' denotes the bosonic dimensions, and ''N'' denotes the Grassmann dimensions.


Computing


Pipe

A pipe is an
inter-process communication In computer science, interprocess communication (IPC) is the sharing of data between running Process (computing), processes in a computer system. Mechanisms for IPC may be provided by an operating system. Applications which use IPC are often cat ...
mechanism originating in Unix, which directs the output (standard out and, optionally, standard error) of one process to the input (standard in) of 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 ("bash file"). In most
Unix shell A Unix shell is a Command-line_interface#Command-line_interpreter, command-line interpreter or shell (computing), shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command languag ...
s (command interpreters), this is represented by the vertical bar character. For example: grep -i 'blair' filename.log , more where the output from the grep process (all lines containing 'blair') is piped to the more process (which allows a command line user to read through results one page at a time). The same "pipe" feature is also found in later versions of DOS and Microsoft Windows. This usage has led to the character itself being called "pipe".


Disjunction

In many programming languages, the vertical bar is used to designate the logic operation ''or'', either bitwise ''or'' or logical ''or''. Specifically, in C and other languages following C syntax conventions, such as C++, Perl,
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
and C#, a , b denotes a bitwise ''or''; whereas a double vertical bar a , , b denotes a ( short-circuited) logical ''or''. Since the character was originally not available in all code pages and keyboard layouts, ANSI C can transcribe it in form of the trigraph ??!, which, outside string literals, is equivalent to the , character. In regular expression syntax, the vertical bar again indicates logical ''or'' ( alternation). For example: the Unix command grep -E 'fu, bar' matches lines containing 'fu' or 'bar'.


Concatenation

The double vertical bar operator ", , " denotes string
concatenation In formal language theory and computer programming, string concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball". In certain formalizations of concatenati ...
in PL/I, REXX, ooRexx, standard ANSI SQL, and theoretical computer science (particularly
cryptography Cryptography, or cryptology (from "hidden, secret"; and ''graphein'', "to write", or ''-logy, -logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of Adversary (cryptography), ...
).


Delimiter

Although not as common as commas or tabs, the vertical bar can be used as a delimiter in a flat file. Examples of a pipe-delimited standard data format are LEDES 1998B and HL7. It is frequently used because vertical bars are typically uncommon in the data itself. Similarly, the vertical bar may see use as a delimiter for regular expression operations (e.g. in sed). This is useful when the regular expression contains instances of the more common forward slash (/) delimiter; using a vertical bar eliminates the need to escape all instances of the forward slash. However, this makes the bar unusable as the regular expression "alternative" operator.


Backus–Naur form

In
Backus–Naur form In computer science, Backus–Naur form (BNF, pronounced ), also known as Backus normal form, is a notation system for defining the Syntax (programming languages), syntax of Programming language, programming languages and other Formal language, for ...
, an expression consists of sequences of symbols and/or sequences separated by ', ', indicating a
choice A choice is the range of different things from which a being can choose. The arrival at a choice may incorporate Motivation, motivators and Choice modelling, models. Freedom of choice is generally cherished, whereas a severely limited or arti ...
, the whole being a possible substitution for the symbol on the left.


Concurrency operator

In calculi of communicating processes (like pi-calculus), the vertical bar is used to indicate that processes execute in parallel.


APL

The pipe in APL is the modulo or ''residue'' function between two operands and the absolute value function next to one operand.


List comprehensions

The vertical bar is used for list comprehensions in some functional languages, e.g. Haskell and Erlang. Compare set-builder notation.


Text markup

The vertical bar is used as a special character in lightweight markup languages, notably MediaWiki's Wikitext (in the templates and internal links). In LaTeX text mode, the vertical bar produces an
em dash The dash is a punctuation mark consisting of a long horizontal line. It is similar in appearance to the hyphen but is longer and sometimes higher from the baseline. The most common versions are the endash , generally longer than the hyphen ...
(—). The \textbar command can be used to produce a vertical bar.


Phonetics and orthography

In the
Khoisan languages The Khoisan languages ( ; also Khoesan or Khoesaan) are a number of Languages of Africa, African languages once classified together, originally by Joseph Greenberg. Khoisan is defined as those languages that have click languages, click consonant ...
and the
International Phonetic Alphabet The International Phonetic Alphabet (IPA) is an alphabetic system of phonetic notation based primarily on the Latin script. It was devised by the International Phonetic Association in the late 19th century as a standard written representation ...
, the vertical bar is used to write the dental click (). A double vertical bar is used to write the alveolar lateral click (). Since these are technically letters, they have their own
Unicode Unicode or ''The Unicode Standard'' or TUS is a character encoding standard maintained by the Unicode Consortium designed to support the use of text in all of the world's writing systems that can be digitized. Version 16.0 defines 154,998 Char ...
code points in the Latin Extended-B range: and . Some
Northwest The points of the compass are a set of horizontal, radially arrayed compass directions (or azimuths) used in navigation and cartography. A '' compass rose'' is primarily composed of four cardinal directions—north, east, south, and west— ...
and Northeast Caucasian languages written in the
Cyrillic script The Cyrillic script ( ) is a writing system used for various languages across Eurasia. It is the designated national script in various Slavic languages, Slavic, Turkic languages, Turkic, Mongolic languages, Mongolic, Uralic languages, Uralic, C ...
have a vertical bar called
palochka The palochka () is a letter in the Cyrillic script. The letter is usually caseless. It was introduced in the late 1930s as the Hindu-Arabic digit ' 1', and on Cyrillic keyboards, it is usually typeset as the Roman numeral ''. Unicode currentl ...
(), indicating the preceding consonant is an ejective. Longer single and double vertical bars are used to mark
prosodic In linguistics, prosody () is the study of elements of speech, including intonation (linguistics), intonation, stress (linguistics), stress, Rhythm (linguistics), rhythm and loudness, that occur simultaneously with individual phonetic segments: v ...
boundaries in the IPA.


Literature

In medieval European manuscripts, a single vertical bar was a common variant of the virgula used as a
comma The comma is a punctuation mark that appears in several variants in different languages. Some typefaces render it as a small line, slightly curved or straight, but inclined from the vertical; others give it the appearance of a miniature fille ...
,. or caesura mark. In
Sanskrit Sanskrit (; stem form ; nominal singular , ,) is a classical language belonging to the Indo-Aryan languages, Indo-Aryan branch of the Indo-European languages. It arose in northwest South Asia after its predecessor languages had Trans-cultural ...
and other Indian languages, a single vertical mark, ।, called a danda, has a similar function as a period (full stop). Two bars, ॥, (a 'double danda') is the equivalent of a pilcrow in marking the end of a stanza, paragraph or section. The danda has its own Unicode code point, ; as does the double danda: .


Poetry

A double vertical bar or is the standard '' caesura mark'' in English
literary criticism A genre of arts criticism, literary criticism or literary studies is the study, evaluation, and interpretation of literature. Modern literary criticism is often influenced by literary theory, which is the philosophical analysis of literature's ...
and analysis. It marks the strong break or caesura common to many forms of
poetry Poetry (from the Greek language, Greek word ''poiesis'', "making") is a form of literature, literary art that uses aesthetics, aesthetic and often rhythmic qualities of language to evoke meaning (linguistics), meanings in addition to, or in ...
, particularly Old English verse. It is also traditionally used to mark the division between lines of verse printed as prose (the style preferred by
Oxford University Press Oxford University Press (OUP) is the publishing house of the University of Oxford. It is the largest university press in the world. Its first book was printed in Oxford in 1478, with the Press officially granted the legal right to print books ...
), though it is now often replaced by the forward slash.


Notation

In the Geneva Bible and early printings of the
King James Version The King James Version (KJV), also the King James Bible (KJB) and the Authorized Version (AV), is an Early Modern English Bible translations, Early Modern English translation of the Christianity, Christian Bible for the Church of England, wh ...
, a double vertical bar is used to mark margin notes that contain an alternative translation from the original text. These margin notes always begin with the conjunction "Or". In later printings of the King James Version, the double vertical bar is irregularly used to mark any comment in the margins. A double vertical bar symbol may be used to call out a footnote. (The traditional order of these symbols in English is *, , , §, ‖, , so its use is very rare; in modern usage, numbers and letters are preferred for endnotes and footnotes.)


Music scoring

In music, when writing chord sheets, single vertical bars associated with a colon (, : A / / / :, ) represents the beginning and end of a section (e.g. Intro, Interlude, Verse, Chorus) of music. Single bars can also represent the beginning and end of measures (, : A / / / , D / / / , E / / / :, ). A double vertical bar associated with a colon can represent the repeat of a given section (, , : A / / / :, , - play twice).


Encoding


Solid vertical bar versus broken bar

Many early video terminals and dot-matrix printers rendered the vertical bar character as the
allograph In graphemics and typography, the term allograph is used of a glyph that is a design variant of a letter or other grapheme, such as a letter, a number, an ideograph, a punctuation mark or other typographic symbol. In graphemics, an obvious exa ...
broken bar . This may have been to distinguish the character from the lower-case 'L' and the upper-case '' on these limited-resolution devices, and to make a vertical line of them look more like a horizontal line of dashes. It was also (briefly) part of the
ASCII ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
standard. An initial draft for a 7-bit character set that was published by the X3.2 subcommittee for Coded Character Sets and Data Format on June 8, 1961, was the first to include the vertical bar in a standard set. The bar was intended to be used as the representation for the
logical OR In logic, disjunction (also known as logical disjunction, logical or, logical addition, or inclusive disjunction) is a logical connective typically notated as \lor and read aloud as "or". For instance, the English language, English language ...
symbol. A subsequent draft on May 12, 1966, places the vertical bar in column 7 alongside regional entry codepoints, and formed the basis for the original draft proposal used by the International Standards Organisation. This draft received opposition from the
IBM International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
user group SHARE, with its chairman, H. W. Nelson, writing a letter to the American Standards Association titled "The Proposed revised American Standard Code for Information Interchange does NOT meet the needs of computer programmers!"; in this letter, he argues that no characters within the international subset designated at columns 2-5 of the character set would be able to adequately represent logical OR and logical NOT in languages such as IBM's PL/I universally on all platforms. As a compromise, a requirement was introduced where the exclamation mark (!) and
circumflex The circumflex () is a diacritic in the Latin and Greek scripts that is also used in the written forms of many languages and in various romanization and transcription schemes. It received its English name from "bent around"a translation of ...
(^) would display as logical OR (, ) and logical NOT (¬) respectively in use cases such as programming, while outside of these use cases they would represent their original typographic symbols: The original vertical bar encoded at 0x7C in the original May 12, 1966 draft was then broken as , so it could not be confused with the unbroken logical OR. In the 1967 revision of ASCII, along with the equivalent ISO 464 code published the same year, the code point was defined to be a broken vertical bar, and the exclamation mark character was allowed to be rendered as a solid vertical bar. However, the 1977 revision (ANSI X.3-1977) undid the changes made in the 1967 revision, enforcing that the circumflex could no longer be stylised as a logical NOT symbol, the exclamation mark likewise no longer allowing stylisation as a vertical bar, and defining the code point originally set to the broken bar as a solid vertical bar instead; the same changes were also reverted in ISO 646-1973 published four years prior. Some variants of EBCDIC included both versions of the character as different code points. The broad implementation of the
extended ASCII Extended ASCII is a repertoire of character encodings that include (most of) the original 96 ASCII character set, plus up to 128 additional characters. There is no formal definition of "extended ASCII", and even use of the term is sometimes critic ...
ISO/IEC 8859 series in the 1990s also made a distinction between the two forms. This was preserved in Unicode as a separate character at (the term "parted rule" is used sometimes in Unicode documentation). Some fonts draw the characters the same (both are solid vertical bars, or both are broken vertical bars). The broken bar does not appear to have any clearly identified uses distinct from those of the vertical bar. In non-computing use — for example in mathematics, physics and general typography — the broken bar is not an acceptable substitute for the vertical bar. In some dictionaries, the broken bar is used to mark stress that may be either primary or secondary: covers the pronunciations and .For example, .


Unicode code points

These glyphs are encoded in Unicode as follows: * (single vertical line) * (single broken line) * (double vertical line ( \, ): used in pairs to indicate norm) * ( Fullwidth form) * * * * * * (and various other box drawing characters in the range U+2500 to U+257F) * * *


Code pages and other historical encodings


See also

* *


Notes


References

{{navbox punctuation Punctuation Typographical symbols Logic symbols