| > | |
|---|---|
Greater-than sign | |
| In Unicode | U+003E >GREATER-THAN SIGN (>, >) |
| Different from | |
| Different from | U+232A 〉RIGHT-POINTING ANGLE BRACKET |
| Related | |
| See also | U+2265 ≥GREATER-THAN OR EQUAL TO U+2A7E ⩾GREATER-THAN OR SLANTED EQUAL TO U+226B ≫MUCH GREATER-THAN |
Thegreater-than sign is a mathematical symbol that denotes aninequality between two values. The widely adopted form of two equal-length strokes connecting in an acute angle at the right,>, has been found in documents dated as far back as 1631.[1] In mathematical writing, the greater-than sign is typically placed between two values being compared and signifies that the first number is greater than the second number. Examples of typical usage include1.5 > 1 and1 > −2. The less-than sign and greater-than sign always "point" to the smaller number. Since the development of computerprogramming languages, the greater-than sign and theless-than sign have been repurposed for a range of uses and operations.
The earliest known use of the symbols< and> is found inArtis Analyticae Praxis ad Aequationes Algebraicas Resolvendas (The Analytical Arts Applied to Solving Algebraic Equations) byThomas Harriot, published posthumously in 1631.[1] The text states "Signum majoritatis ut a > bsignificet amajorem quam b (The sign of majority a > b indicates that a is greater than b)" and "Signum minoritatis ut a < bsignificet aminorem 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 aNative American with a symbol that resembled the greater-than sign,[1] in both backwards and forwards forms.[2] Johnson says it is likely Harriot developed the two symbols from this symbol.[2]
The greater-than sign is sometimes used for an approximation of theclosing angle bracket,⟩. The proper Unicode character isU+232A 〉RIGHT-POINTING ANGLE BRACKET. ASCII does not have angular brackets.
InHTML (andSGML andXML), 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.
In some earlye-mail systems, the greater-than sign was used to denotequotations.[3]The sign is also used to denote quotations inMarkdown.[4]
The 'greater-than sign'> is encoded inASCII as character hex 3E, decimal 62. TheUnicodecode point isU+003E >GREATER-THAN SIGN, inherited from ASCII.
For use withHTML, the mnemonics> or> may also be used.
BASIC andC-family languages (includingJava[5] andC++) use thecomparison operator> to mean "greater than". InLisp-family languages,> is a function used to mean "greater than".InColdfusion andFortran, operator.GT. means "greater than".
>> is used for an approximation of themuch-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 closingguillemet,».
InJava,C, andC++, the operator>> is theright-shift operator. In C++ it is also used to get input from astream, similar to the C functionsgetchar andfgets.
InHaskell, 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.
InXPath the>> operator returns true if the left operand follows the right operand in document order; otherwise it returns false.[6]
>>> is the unsigned-right-shift operator inJavaScript. Three greater-than signs form the distinctive prompt of the firmware console inMicroVAX,VAXstation, andDEC Alpha computers (known as theSRM console in the latter). This is also the default prompt of thePython interactive shell, often seen for code examples that can be executed interactively in the interpreter:
$ pythonPython 3.9.2 (default, Feb 20 2021, 18:40:11)[GCC 10.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>>print("Hello World")Hello World>>>
>= is sometimes used for an approximation of thegreater than or equal to sign,≥ which was not included in the ASCII repertoire. The sign is, however, provided inUnicode, asU+2265 ≥GREATER-THAN OR EQUAL TO (≥, ≥, ≥).
InBASIC,Lisp-family languages,Lua andC-family languages (includingJava andC++) the operator>= means "greater than or equal to". InSinclair BASIC it is encoded as a single-byte code point token.
InFortran, the operator.GE. means "greater than or equal to".
InBourne shell andWindows PowerShell, the operator-ge means "greater than or equal to".
-> is used in some programming languages (for exampleF#) to create an arrow. Arrows like these could also be used in text where otherarrow symbols are unavailable. In theR programming language, this can be used as the right assignment operator. In theC,C++, andPHP, this is used as a member access operator. InSwift andPython, it is used to indicate the return value type when defining afunction (i.e.,funcfoo()->MyClass{...}).
InBourne shell (and many other shells), greater-than sign is used toredirect output to a file. Greater-than plus ampersand (>&) is used to redirect to afile descriptor.
Greater-than sign is used in the 'spaceship operator',<=>.
InECMAScript andC#, the greater-than sign is used in lambda function expressions.
In ECMAScript:
constsquare=x=>x*x;console.log(square(5));// 25
In C#:
Func<int,int>square=x=>x*x;Console.WriteLine(square(5));// 25
InPHP, 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.
$x=5;$y=3;$z=5;echo$x<>$y;// trueecho$x<>$z;// false
Unicode provides various greater than symbols:[7] (use ⇕ controls to change sort order temporarily)
| Symbol | Code Point | Unicode name |
|---|---|---|
| > | U+003E | GREATER-THAN SIGN |
| ≥ | U+2265 | GREATER-THAN OR EQUAL TO |
| ≧ | U+2267 | GREATER-THAN OVER EQUAL TO |
| ≩ | U+2269 | GREATER-THAN BUT NOT EQUAL TO |
| ≫ | U+226B | MUCH GREATER-THAN |
| ≯ | U+226F | NOT GREATER-THAN |
| ≱ | U+2271 | NEITHER GREATER-THAN NOR EQUAL TO |
| ≳ | U+2273 | GREATER-THAN OR EQUIVALENT TO |
| ≵ | U+2275 | NEITHER GREATER-THAN NOR EQUIVALENT TO |
| ⋗ | U+22D7 | GREATER-THAN WITH DOT |
| ⋙ | U+22D9 | VERY MUCH GREATER-THAN |
| ⋝ | U+22DD | EQUAL TO OR GREATER-THAN |
| ⋧ | U+22E7 | GREATER-THAN BUT NOT EQUIVALENT TO |
| ⍄ | U+2344 | APL FUNCTIONAL SYMBOL QUAD GREATER-THAN |
| ⍩ | U+2369 | APL FUNCTIONAL SYMBOL GREATER-THAN DIAERESIS |
| ⦕ | U+2995 | DOUBLE LEFT ARC GREATER-THAN BRACKET |
| ⥸ | U+2978 | GREATER-THAN ABOVE RIGHTWARDS ARROW |
| ⧁ | U+29C1 | CIRCLED GREATER-THAN |
| ⩺ | U+2A7A | GREATER-THAN WITH CIRCLE INSIDE |
| ⪚ | U+2A9A | DOUBLE-LINE EQUAL TO OR GREATER-THAN |
| ⪜ | U+2A9C | DOUBLE-LINE SLANTED EQUAL TO OR GREATER-THAN |
| ⩾ | U+2A7E | GREATER-THAN OR SLANTED EQUAL TO |
| ⪀ | U+2A80 | GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE |
| ⪂ | U+2A82 | GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE |
| ⪄ | U+2A84 | GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE LEFT |
| ⪆ | U+2A86 | GREATER-THAN OR APPROXIMATE |
| ⪎ | U+2A8E | GREATER-THAN ABOVE SIMILAR OR EQUAL |
| ⪊ | U+2A8A | GREATER-THAN AND NOT APPROXIMATE |
| ⪈ | U+2A88 | GREATER-THAN AND SINGLE-LINE NOT EQUAL TO |
| ⪢ | U+2AA2 | DOUBLE NESTED GREATER-THAN |
| ⪧ | U+2AA7 | GREATER-THAN CLOSED BY CURVE |
| ⪩ | U+2AA9 | GREATER-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL |
| ⫺ | U+2AFA | DOUBLE-LINE SLANTED GREATER-THAN OR EQUAL TO |
| ⩼ | U+2A7C | GREATER-THAN WITH QUESTION MARK ABOVE |
| ⦔ | U+2994 | RIGHT ARC GREATER-THAN BRACKET |
| ⪖ | U+2A96 | SLANTED EQUAL TO OR GREATER-THAN |
| ⪘ | U+2A98 | SLANTED EQUAL TO OR GREATER-THAN WITH DOT INSIDE |
| ⪞ | U+2A9E | SIMILAR OR GREATER-THAN |
| ⪠ | U+2AA0 | SIMILAR ABOVE GREATER-THAN ABOVE EQUALS SIGN |
| ⫸ | U+2AF8 | TRIPLE NESTED GREATER-THAN |
| ﹥ | U+FE65 | SMALL GREATER THAN SIGN |
| > | U+FF1E | FULLWIDTH GREATER THAN SIGN |