|
|
Line 1: |
Line 1: |
| {{redirect|||its use in vertical Japanese writing|Chōonpu}}
| | My name is Rosalie and I am studying Graduate School and Social Science Education at Houilles / France.<br><br>my blog post: [http://50.28.7.200/~thegloc/groups/want-to-start-4inkjets-coupon-follow-this-advice/ 4Inkjets Promo Code] |
| {{Refimprove|date=July 2012}}
| |
| | |
| {{Punctuation marks||<!--
| |
| -->|variant1=¦|caption1=[[#Solid vertical bar vs broken bar|Broken bar]]<!--
| |
| -->|variant2=‖|caption2=[[#Mathematics|Magnitude]]<!--
| |
| -->|variant3=∣|caption3=[[divisibility|Divides]]<!--
| |
| -->|variant-size=400%}}
| |
| The '''vertical bar''' ('''|''') is a character with various uses in mathematics, computing, and typography. It may be called by various other names including the '''polon''', '''pipe''' (by the [[Unix]] community, referring to the [[Pipeline (Unix)|I/O pipeline]] construct), [[Sheffer stroke]] (by computer or mathematical [[History of logic|logicians]]), '''verti-bar''', '''vbar''', '''stick''', '''vertical line''', '''vertical slash''', '''or bar''', '''glidus''', '''think colon''', '''poley''', or '''divider line'''.{{Citation needed|reason=source needed for list of names|date=June 2012}}
| |
| | |
| ==Usage==
| |
| | |
| ===Mathematics===
| |
| The vertical bar is used as a [[table of mathematical symbols|mathematical symbol]] in
| |
| * [[absolute value]]: <math>|x|</math>, read ''"the '''absolute value''' of [[x]]"''.
| |
| * [[norm (mathematics)|norm]]s: <math>\|(x_1,x_2)\|</math>, read ''"the '''norm''' of x one, x two"''; though Unicode also provides a special double vertical line symbol U+2016: {{Unicode|‖''x''‖}}
| |
| * [[Parallel (geometry)|Parallelism]] in [[geometry]], where <math>AB \parallel CD</math> indicates that the line <math>AB</math> is parallel to the line <math>CD</math>.
| |
| * [[set-builder notation]]: <math>\{x|x<2\}</math>, read ''"the set of x '''such that''' x is [[less than]] two"''. Often a [[colon (punctuation)|colon]] ':' is used instead of a vertical bar.
| |
| * [[cardinality]]: <math>|S|</math>, read ''"the '''cardinality''' of the set S"''.
| |
| * [[conditional probability]]: <math>P(X|Y)</math>, read ''"the [[probability]] of X '''given''' Y"''.
| |
| * [[divisibility]]: <math>a | b</math>, read ''"a '''divides''' b"'', though Unicode also provides special ‘divides’ and ‘does not divide’ symbols (U+2223 and U+2224: {{Unicode|∣}}, {{Unicode|∤}})
| |
| * the [[Sheffer stroke]] in [[logic]]: <math>a|b</math>, read ''"a '''nand''' b"''.
| |
| * [[distance]]: distance <math>p|ab</math> notes the shortest distance between dot <math>p</math> to line <math>ab</math>, so <math>p|ab</math> is perpendicular to line <math>ab</math>.
| |
| * evaluate (subscript notation): <math>f(x)|_{x=4}</math>, read ''"f of x, evaluated at x equals 4"'' (see [[wikibooks:LaTeX/Advanced Mathematics#Subscripts and superscripts|subscripts]] at Wikibooks)
| |
| * [[Restriction (mathematics)|restriction]]: <math>f|_{A}: A \to F</math> denotes a restriction of function <math>f</math> where it is defined over a domain which is a superset of <math>A</math>.
| |
| * 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]] in [[quantum physics]]. Examples:
| |
| | |
| * <math>|\psi\rangle</math>: The quantum physical state "<math>\psi</math>".
| |
| * <math>\langle\psi|</math>: The [[dual space|dual state]] corresponding to the state above.
| |
| * <math>\langle\psi|\rho\rangle</math>: The [[inner product]] of states <math>\psi</math> and <math>\rho</math>.
| |
| | |
| ===Computing===
| |
| | |
| ==== Pipe ====
| |
| {{Main|Pipeline (Unix)}}
| |
| | |
| A [[pipe (Unix)|pipe]] is an [[inter-process communication]] mechanism originating in [[Unix]] 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 ("bash file"). In most [[Unix shell]]s (command interpreters), this is represented by the vertical bar character. For example:
| |
| | |
| :<tt>[[grep]] -i 'blair' filename.log | [[More_(command)#Unix|more]]</tt>
| |
| | |
| where the output from the "grep" process is piped to the "more" process.
| |
| | |
| The same "pipe" feature is also found in later versions of [[DOS]] and Microsoft Windows.
| |
| | |
| ====Disjunction====
| |
| In many programming languages, the vertical bar is used to designate the [[Logical disjunction|logic operation ''or'']], either [[Bitwise operation|bitwise]] ''or'' or [[Boolean datatype|logical]] ''or''.
| |
| | |
| Specifically, in [[C (programming language)|C]] and other languages following C syntax conventions, such as [[C++]], [[Perl]], [[Java (programming language)|Java]] and [[C Sharp (programming language)|C#]], <code>(a | b)</code> denotes a [[Bitwise operation#OR|bitwise or]]; whereas a double vertical bar <code>(a || b)</code> denotes a ([[Minimal evaluation|short-circuited]]) [[logical disjunction|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 [[C trigraph|trigraph]] <code>??!</code> which, outside string literals, is equivalent to the <code>|</code> character.
| |
| | |
| In [[regular expression]] syntax, the vertical bar again indicates logical ''or''. For example: the Unix command <tt>[[grep]] -E 'foo|bar'</tt> matches lines containing 'foo' or 'bar'.
| |
| | |
| ====Concatenation====
| |
| In [[PL/I]] and standard ANSI [[SQL]], the operator "||" denotes [[string (computer science)|string]] [[concatenation]].
| |
| | |
| ====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 (<code>/</code>) delimiter; using a vertical bar eliminates the need to escape all instances of the forward slash.
| |
| | |
| ====Backus-Naur form====
| |
| In [[Backus-Naur form]], an expression consists of sequences of symbols and/or sequences separated by '|', indicating a [[Alternation (formal language theory)|choice]], the whole being a possible substitution for the symbol on the left.
| |
| :<personal-name> ::= <name> | <initial>
| |
| | |
| ====Concurrency operator====
| |
| In calculi of communicating processes (like [[pi-calculus]]), the vertical bar is used to indicate that processes execute in parallel.
| |
| | |
| ====Modular arithmetic====
| |
| In [[APL (programming language)|APL]], it is the modulo function (called ''residue'' in APL) when between two operands.
| |
| | |
| ====Absolute Value====
| |
| In [[APL (programming language)|APL]], it is the absolute value function when before a single operand.
| |
| | |
| ====List comprehensions====
| |
| {{Main|List comprehensions}}
| |
| | |
| The vertical bar is used for list comprehensions in some functional languages, e.g. [[Haskell (programming language)|Haskell]] and [[Erlang (programming language)|Erlang]]. Compare [[#Mathematics|set-builder notation]].
| |
| | |
| ===Phonetics and orthography===
| |
| In the [[Khoisan languages]] and the [[International Phonetic Alphabet]], the vertical bar is used to write the [[dental click]] ({{IPA|ǀ}}). A double vertical bar is used to write the [[alveolar lateral click]] ({{IPA|ǁ}}). Since these are technically letters, they have their own [[Unicode]] 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 [[Prosody (linguistics)|prosodic]] boundaries in the IPA.
| |
| | |
| ===Bibles===
| |
| *In the Geneva Bible and early printings of the King James Version, the double vertical bar is used to indicate that an alternative translation is to be found in the margin. Whenever it is used, the marginal note begins with the conjunction "Or".
| |
| *In later printings of the King James Version, the double vertical bar may be used to indicate that a comment is to be found in the margin.
| |
| | |
| ==Encoding==
| |
| | |
| The vertical bar ("|") is at position 124 (decimal) in the [[ASCII]] character set.
| |
| | |
| === Solid vertical bar vs broken bar ===<!-- linked from an infobox in this article -->
| |
| [[Image:Dot printer ASCII0x7C+.png|320px|thumb|right|The code point 124 (7C [[hexadecimal]]) is occupied by a broken bar in a [[dot matrix printer]] of late 1980s, which apparently lacks a solid vertical bar. Due to this, broken bar is also used for [[line drawing characters|vertical line]] [[typographic approximation|approximation]]; a [[:Image:Dot printer ASCII.png|full picture]] (3,136 × 2,624 pixels).]]
| |
| The '''broken bar''' ('''¦''') in computing was historically an [[allograph]] of the vertical bar and was perceived so before a broad implementation of [[extended ASCII]] character sets (namely, [[ISO/IEC 8859]] series), which did distinguish both. Since the 1990s, it is considered a separate character, not a part of ASCII, and also termed "parted rule" in Unicode documentation. But in the [[text mode]] fonts, as well as in other [[text user interface|TUI]] applications on [[DOS]], [[Microsoft Windows|Windows]] and [[Unix-like]] systems, the glyph used for the vertical bar may look exactly like a broken bar. This is no longer the case on Windows 7.<ref>{{cite web|url=http://www.jimprice.com/jim-asc.shtml#extended|title=ASCII Chart: IBM PC Extended ASCII Display Characters|author=Jim Price|date=2010-05-24|accessdate=2012-02-23}}</ref>
| |
| | |
| Due to historical confusion between the two, computer keyboards and displays may not clearly or consistently differentiate them. The typical [[keyboard layout]] used in the [[United Kingdom]] features separate keys for vertical bar and broken bar; however, typically on [[Microsoft Windows|Windows]] PCs the vertical bar key produces a broken-bar symbol.{{Citation needed|date=July 2013}} 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 <tt>[[AltGr key|AltGr]]</tt>.
| |
| | |
| The broken bar has hardly any practical application and does not appear to have any clearly identified uses distinct from the vertical bar.<ref>{{cite web|url=http://www.cs.tut.fi/~jkorpela/latin1/3.html#A6|title=Detailed descriptions of the characters|date=2006-09-20|author=Jukka "Yucca" Korpela|accessdate=2012-02-23}}</ref> In non-computing use — for example in mathematics, physics and general typography — the broken bar is not an acceptable substitute for the vertical bar. Aforementioned usages in computing rely on the [[character (computing)|abstract character]] with [[code point]] 124 (0x7C) in ASCII (or ASCII compatible [[code page]]) and do not depend on visual rendering, which actually may be a broken bar in some environments.<!-- I saw personally the logical OR operator in C rendered as ЭЭ in KOI-7 environment, but it is a bit off-topical here. --Incnis Mrsi -->
| |
| | |
| Some variants of the [[EBCDIC]] family of code pages such as [[EBCDIC 500]] had distinguished broken bar from a solid vertical bar.{{Citation needed|date=February 2012}}
| |
| | |
| ===In common character maps===
| |
| | |
| {| class="wikitable"
| |
| !
| |
| !Vertical bar ('<nowiki>|</nowiki>')
| |
| !Broken bar ('[[¦]]')
| |
| |-
| |
| |[[ASCII]],<br>[[CP437]], [[CP667]], [[CP720]], [[CP737]], [[CP790]], [[CP819]], [[CP852]], [[CP855]], [[CP860]], [[CP861]], [[CP862]], [[CP865]], [[CP866]], [[CP867]], [[CP869]], [[CP872]], [[CP895]], [[CP932]], [[CP991]]
| |
| |124 (7C[[hexadecimal|h]])
| |
| |N/A<ref>Broken bar is no longer considered a part of ASCII since early 1990s</ref>
| |
| |-
| |
| |[[CP775]]
| |
| |124 (7Ch)
| |
| |167 (A7h)
| |
| |-
| |
| |[[CP850]], [[CP857]], [[CP858]]
| |
| |124 (7Ch)
| |
| |221 (DDh)
| |
| |-
| |
| |[[CP863]]
| |
| |124 (7Ch)
| |
| |160 (A0h)
| |
| |-
| |
| |[[CP864]]
| |
| |124 (7Ch)
| |
| |219 (DBh)
| |
| |-
| |
| |[[ISO/IEC 8859-1]], [[ISO/IEC 8859-7|-7]], [[ISO/IEC 8859-8|-8]], [[ISO/IEC 8859-9|-9]], [[ISO/IEC 8859-13|-13]],<br>[[CP1250]], [[CP1251]], [[CP1252]], [[CP1253]], [[CP1254]], [[CP1255]], [[CP1256]], [[CP1257]], [[CP1258]]
| |
| |124 (7Ch)
| |
| |166 (A6h)
| |
| |-
| |
| |[[ISO/IEC 8859-2]], [[ISO/IEC 8859-3|-3]], [[ISO/IEC 8859-4|-4]], [[ISO/IEC 8859-5|-5]], [[ISO/IEC 8859-6|-6]], [[ISO/IEC 8859-10|-10]], [[ISO/IEC 8859-11|-11]], [[ISO/IEC 8859-14|-14]], [[ISO/IEC 8859-15|-15]], [[ISO/IEC 8859-16|-16]]
| |
| |124 (7Ch)
| |
| |N/A
| |
| |-
| |
| |[[Unicode]]
| |
| |U+007C
| |
| |U+00A6
| |
| |-
| |
| |[[EBCDIC]] ([[EBCDIC 500|CCSID 500]] variant)
| |
| |187 (BBh)
| |
| |166 (A6h)
| |
| |-
| |
| |[[Shift-JIS]] Men-Ku-Ten
| |
| |1-01-35
| |
| |
| |
| |-
| |
| | [[HTML]]
| |
| | &#124;
| |
| | &brvbar; or &#166;
| |
| |}
| |
| | |
| Additional related Unicode characters:
| |
| | |
| *Double vertical line ('{{IPA|‖}}'): U+2016
| |
| *Latin letter dental click ({{unicode|⟨ǀ⟩}}): U+01C0
| |
| *Latin letter lateral click ({{unicode|⟨ǁ⟩}}): U+01C1
| |
| *Symbol 'divides' ({{unicode|⟨∣⟩}}): U+2223
| |
| *Various [[Box-drawing characters]] at U+2500 to U+257F
| |
| | |
| ===In text processing===
| |
| In [[LaTeX]], the vertical bar can be used as delimiter in [[TeX#math mode|mathematical mode]]. The sequence <tt>\|</tt> creates a double vertical line (<tt>a | b \| c</tt> is set as <math>a | b \| c</math>). This has different spacing from <tt>\mid</tt> and <tt>\parallel</tt>, which are [[relational operator]]s: <tt>a \mid b \parallel c</tt> is set as <math>a \mid b \parallel c</math>. In LaTeX text mode, the vertical bar produces an [[em dash]] (—), or you can use the <tt>\textbar</tt> command instead.
| |
| | |
| The vertical bar is also used as special character in other [[Lightweight markup language]]s, notably Wikipedia's own [[Wikitext]].
| |
| | |
| ==See also==
| |
| *[[Danda]]
| |
| | |
| ==References==
| |
| <references/>
| |
| | |
| [[Category:Punctuation]]
| |
| [[Category:Typographical symbols]]
| |
| [[Category:Logic symbols]]
| |