Greater-than sign
Mathematical symbol for "greater than"
- 5 min read
- 4 chapters
- 1 lab on Lably
Learn it on Lably
History
The earliest known use of the symbols < and > is found in Artis Analyticae Praxis ad Aequationes Algebraicas Resolvendas (The Analytical Arts Applied to Solving Algebraic Equations) by Thomas Harriot, published posthumously in 1631. The text states "Signum majoritatis ut a > b significet a majorem quam b (The sign of majority a > b indicates that a is greater than b)" and "Signum minoritatis ut a < b significet a minorem quam b (The sign of minority a < b indicates that a is less than b)."
According to historian Art Johnson, while Harriot was surveying North America, he saw a Native American with a symbol that resembled the greater-than sign, in both backwards and forwards forms. Johnson says it is likely Harriot developed the two symbols from this symbol.
Sign in to keep reading
3 more chapters are free with a Lably account.
Usage in text markup
Angle brackets
The greater-than sign is sometimes used for an approximation of the closing angle bracket, ⟩. The proper Unicode character is U+232A 〉 RIGHT-POINTING ANGLE BRACKET. ASCII does not have angular brackets.
HTML
In HTML (and SGML and XML), the greater-than sign is used at the end of tags. The greater-than sign may be included with >, while ≥ produces the greater-than or equal to sign.
Quoting
In some e-mail systems, the greater-than sign is used to denote quotations. The sign is also used to denote quotations in Markdown.
The diple was a mark resembling a greater-than that was sometimes used to mark quotations.
Usage in programming
The 'greater-than sign' > is encoded in ASCII as character hex 3E, decimal 62. The Unicode code point is U+003E > GREATER-THAN SIGN, inherited from ASCII.
For use with HTML, the mnemonics > or > may also be used.
Programming language
BASIC and C-family languages (including Java and C++) use the comparison operator > to mean "greater than". In Lisp-family languages, > is a function used to mean "greater than". In Coldfusion and Fortran, operator .GT. means "greater than".
Double greater-than sign
>> is used for an approximation of the much-greater-than sign ≫. ASCII does not have the much greater-than sign.
The double greater-than sign is also used for an approximation of the closing guillemet, ».
In Java, C, and C++, the operator >> is the right-shift operator. In C++ it is also used to get input from a stream, similar to the C functions getchar and fgets.
In Haskell, the >> function is a monadic operator. It is used for sequentially composing two actions, discarding any value produced by the first. In that regard, it is like the statement sequencing operator in imperative languages, such as the semicolon in C.
In XPath the >> operator returns true if the left operand follows the right operand in document order; otherwise it returns false.
Triple greater-than sign
>>> is the unsigned-right-shift operator in JavaScript. Three greater-than signs form the distinctive prompt of the firmware console in MicroVAX, VAXstation, and DEC Alpha computers (known as the SRM console in the latter). This is also the default prompt of the Python interactive shell, often seen for code examples that can be executed interactively in the interpreter:
<span id="mwqA"></span><span class="hll" id="mwqQ"><span class="go" id="mwqg">$ python</span> </span><span class="go" id="mwqw">Python 3.9.2 (default, Feb 20 2021, 18:40:11) </span> <span class="go" id="mwrA">[GCC 10.2.0] on linux</span> <span class="go" id="mwrQ">Type "help", "copyright", "credits" or "license" for more information.</span> <span class="gp" id="mwrg">>>> </span><span class="nb" id="mwrw">print</span><span class="p" id="mwsA">(</span><span class="s2" id="mwsQ">"Hello World"</span><span class="p" id="mwsg">)</span> <span class="go" id="mwsw">Hello World</span> <span class="gp" id="mwtA">>>></span>
Greater-than sign with equals sign
>= is sometimes used for an approximation of the greater than or equal to sign, ≥ which was not included in the ASCII repertoire. The sign is, however, provided in Unicode, as U+2265 ≥ GREATER-THAN OR EQUAL TO (≥, ≥, ≥).
In BASIC, Lisp-family languages, Lua and C-family languages (including Java and C++) the operator >= means "greater than or equal to". In Sinclair BASIC it is encoded as a single-byte code point token.
In Fortran, the operator .GE. means "greater than or equal to".
In Bourne shell and Windows PowerShell, the operator -ge means "greater than or equal to".
Hyphen-minus with greater-than sign
-> is used in some programming languages (for example F#) to create an arrow. Arrows like these could also be used in text where other arrow symbols are unavailable. In the R programming language, this can be used as the right assignment operator. In the C, C++, and PHP, this is used as a member access operator. In Swift and Python, it is used to indicate the return value type when defining a function (i.e., func foo() -> MyClass {...}).
Shell scripts
In Bourne shell (and many other shells), greater-than sign is used to redirect output to a file. Greater-than plus ampersand (>&) is used to redirect to a file descriptor.
Spaceship operator
Greater-than sign is used in the 'spaceship operator', <=>.
ECMAScript and C#
In ECMAScript and C#, the greater-than sign is used in lambda function expressions.
In ECMAScript:
<span id="mw-Q"></span><span class="kd" id="mw-g">const</span><span class="w" id="mw-w"> </span><span class="nx" id="mw_A">square</span><span class="w" id="mw_Q"> </span><span class="o" id="mw_g">=</span><span class="w" id="mw_w"> </span><span class="nx" id="mwAQA">x</span><span class="w" id="mwAQE"> </span><span class="p" id="mwAQI">=></span><span class="w" id="mwAQM"> </span><span class="nx" id="mwAQQ">x</span><span class="w" id="mwAQU"> </span><span class="o" id="mwAQY">*</span><span class="w" id="mwAQc"> </span><span class="nx" id="mwAQg">x</span><span class="p" id="mwAQk">;</span> <span class="nx" id="mwAQo">console</span><span class="p" id="mwAQs">.</span><span class="nx" id="mwAQw">log</span><span class="p" id="mwAQ0">(</span><span class="nx" id="mwAQ4">square</span><span class="p" id="mwAQ8">(</span><span class="mf" id="mwARA">5</span><span class="p" id="mwARE">));</span><span class="w" id="mwARI"> </span><span class="c1" id="mwARM">// 25</span>
In C#:
<span id="mwARc"></span><span class="n" id="mwARg">Func</span><span class="o" id="mwARk"><</span><span class="kt" id="mwARo">int</span><span class="p" id="mwARs">,</span><span class="w" id="mwARw"> </span><span class="kt" id="mwAR0">int</span><span class="o" id="mwAR4">></span><span class="w" id="mwAR8"> </span><span class="n" id="mwASA">square</span><span class="w" id="mwASE"> </span><span class="o" id="mwASI">=</span><span class="w" id="mwASM"> </span><span class="n" id="mwASQ">x</span><span class="w" id="mwASU"> </span><span class="o" id="mwASY">=></span><span class="w" id="mwASc"> </span><span class="n" id="mwASg">x</span><span class="w" id="mwASk"> </span><span class="o" id="mwASo">*</span><span class="w" id="mwASs"> </span><span class="n" id="mwASw">x</span><span class="p" id="mwAS0">;</span> <span class="n" id="mwAS4">Console</span><span class="p" id="mwAS8">.</span><span class="n" id="mwATA">WriteLine</span><span class="p" id="mwATE">(</span><span class="n" id="mwATI">square</span><span class="p" id="mwATM">(</span><span class="mi" id="mwATQ">5</span><span class="p" id="mwATU">));</span><span class="w" id="mwATY"> </span><span class="c1" id="mwATc">// 25</span>
PHP
In PHP, the greater-than sign is used in conjunction with the less-than sign as a not equal to operator. It is the same as the != operator.
<span id="mwAT4"></span><span class="nv" id="mwAT8">$x</span> <span class="o" id="mwAUA">=</span> <span class="mi" id="mwAUE">5</span><span class="p" id="mwAUI">;</span> <span class="nv" id="mwAUM">$y</span> <span class="o" id="mwAUQ">=</span> <span class="mi" id="mwAUU">3</span><span class="p" id="mwAUY">;</span> <span class="nv" id="mwAUc">$z</span> <span class="o" id="mwAUg">=</span> <span class="mi" id="mwAUk">5</span><span class="p" id="mwAUo">;</span> <span class="k" id="mwAUs">echo</span> <span class="nv" id="mwAUw">$x</span> <span class="o" id="mwAU0"><></span> <span class="nv" id="mwAU4">$y</span><span class="p" id="mwAU8">;</span> <span class="c1" id="mwAVA">// true</span> <span class="k" id="mwAVE">echo</span> <span class="nv" id="mwAVI">$x</span> <span class="o" id="mwAVM"><></span> <span class="nv" id="mwAVQ">$z</span><span class="p" id="mwAVU">;</span> <span class="c1" id="mwAVY">// false</span>
Unicode
Unicode provides various greater than symbols: (use ⇕ controls to change sort order temporarily)

