Greater-than sign

Last updated
>
Greater-than sign
In  Unicode U+003E>GREATER-THAN SIGN (>, >)
Different from
Different fromU+232ARIGHT-POINTING ANGLE BRACKET
Related
See alsoU+2265 GREATER-THAN OR EQUAL TO

U+2A7EGREATER-THAN OR SLANTED EQUAL TO

U+226FNOT GREATER-THAN
U+226BMUCH GREATER-THAN

The greater-than sign is a mathematical symbol that denotes an inequality 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 include 1.5 > 1 and 1 > −2. The less-than sign and greater-than sign always "point" to the smaller number. Since the development of computer programming languages, the greater-than sign and the less-than sign have been repurposed for a range of uses and operations.

Contents

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. [1] 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, [1] in both backwards and forwards forms. [2] Johnson says it is likely Harriot developed the two symbols from this symbol. [2]

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+232ARIGHT-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 &gt;, while &ge; produces the greater-than or equal to sign.

E-mail and Markdown

In some early e-mail systems, the greater-than sign was used to denote quotations. [3] The sign is also used to denote quotations in Markdown. [4]

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 &gt; or &GT; may also be used.

Programming language

BASIC and C-family languages (including Java [5] 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

The 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. [6]

Triple greater-than sign

The 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:

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

Greater-than sign with equals sign

The greater-than sign plus the 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+2265GREATER-THAN OR EQUAL TO (&ge;, &geq;, &GreaterEqual;).

In BASIC, Lisp-family languages, and C-family languages (including Java and C++), operator >= means "greater than or equal to". In Sinclair BASIC it is encoded as a single-byte code point token.

In Fortran, operator .GE. means "greater than or equal to".

In Bourne shell and Windows PowerShell, the operator -ge means "greater than or equal to".

In Lua, operator >=means "greater than or equal to" and is used like this

x=math.random(1,9)y=5ifx>=ythenprint("x("..x..") is more or equal to y("..y..")")elseprint("x("..x..") is less than y("..y..")")end

expected output:x(number >= 5) is more or equal to y(5) or x(number < 5) is less than y(5)

Hyphen-minus with greater-than sign

In some programming languages (for example F#), the greater-than sign is used in conjunction with a hyphen-minus 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., funcfoo()->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:

constsquare=x=>x*x;console.log(square(5));// 25

In C#:

Func<int,int>square=x=>x*x;Console.WriteLine(square(5));// 25

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.

$x=5;$y=3;$z=5;echo$x<>$y;// trueecho$x<>$z;// false

Unicode

In addition to U+003E>GREATER-THAN SIGN (&gt;, &GT;), Unicode provides various greater than symbols: [7]

SymbolCode PointName
U+2369Apl Functional Symbol Greater-Than Diaeresis
U+2344Apl Functional Symbol Quad Greater-Than
U+29C1Circled Greater-Than
U+2995Double Left Arc Greater-Than Bracket
U+2A9ADouble-Line Equal To Or Greater-Than
U+2A9CDouble-Line Slanted Equal To Or Greater-Than
U+2AFADouble-Line Slanted Greater-Than Or Equal To
U+2AA2Double Nested Greater-Than
U+FF1EFullwidth greater than Sign
U+22DDEqual To Or Greater-Than
U+2978Greater-Than Above Rightwards Arrow
U+2A8EGreater-Than Above Similar Or Equal
U+2A8AGreater-Than And Not Approximate
U+2A88Greater-Than And Single-Line Not Equal To
U+2269Greater-Than But Not Equal To
U+22E7Greater-Than But Not Equivalent To
U+2AA7Greater-Than Closed By Curve
U+2AA9Greater-Than Closed By Curve Above Slanted Equal
U+2A86Greater-Than Or Approximate
U+2265Greater-Than Or Equal To
U+2273Greater-Than Or Equivalent To
U+2A7EGreater-Than Or Slanted Equal To
U+2A82Greater-Than Or Slanted Equal To With Dot Above
U+2A84Greater-Than Or Slanted Equal To With Dot Above Left
U+2A80Greater-Than Or Slanted Equal To With Dot Inside
U+2267Greater-Than Over Equal To
>U+003EGreater-Than Sign
U+2A7AGreater-Than With Circle Inside
U+22D7Greater-Than With Dot
U+2A7CGreater-Than With Question Mark Above
U+226BMuch Greater-Than
U+2271Neither Greater-Than Nor Equal To
U+2275Neither Greater-Than Nor Equivalent To
U+226FNot Greater-Than
U+2994Right Arc Greater-Than Bracket
U+2AA0Similar Above Greater-Than Above Equals Sign
U+2A9ESimilar Or Greater-Than
U+2A96Slanted Equal To Or Greater-Than
U+2A98Slanted Equal To Or Greater-Than With Dot Inside
U+FE65Small greater than sign
U+2AF8Triple Nested Greater-Than
U+22D9Very Much Greater-Than

See also

Related Research Articles

The colon, :, is a punctuation mark consisting of two equally sized dots aligned vertically. A colon often precedes an explanation, a list, or a quoted sentence. It is also used between hours and minutes in time, between certain elements in medical journal citations, between chapter and verse in Bible citations, and, in the US, for salutations in business letters and other formal letter writing.

A bracket is either of two tall fore- or back-facing punctuation marks commonly used to isolate a segment of text or data from its surroundings. They come in four main pairs of shapes, as given in the box to the right, which also gives their names, that vary between British and American English. "Brackets", without further qualification, are in British English the () marks and in American English the [] marks.

A mathematical symbol is a figure or a combination of figures that is used to represent a mathematical object, an action on mathematical objects, a relation between mathematical objects, or for structuring the other symbols that occur in a formula. As formulas are entirely constituted with symbols of various types, many symbols are needed for expressing all mathematics.

The backslash\ is a mark used mainly in computing and mathematics. It is the mirror image of the common slash /. It is a relatively recent mark, first documented in the 1930s. It is sometimes called a hack, whack, escape, reverse slash, slosh, downwhack, backslant, backwhack, bash, reverse slant, reverse solidus, and reversed virgule.

The tilde˜ or ~, is a grapheme with a number of uses. The name of the character came into English from Spanish, which in turn came from the Latin titulus, meaning 'title' or 'superscription'. Its primary use is as a diacritic (accent) in combination with a base letter; but, for historical reasons, it is also used in standalone form within a variety of contexts.

The plus sign and the minus sign are mathematical symbols used to denote positive and negative functions, respectively. In addition, + represents the operation of addition, which results in a sum, while represents subtraction, resulting in a difference. Their use has been extended to many other meanings, more or less analogous. Plus and minus are Latin terms meaning "more" and "less", respectively.

The multiplication sign, also known as the times sign or the dimension sign, is a mathematical symbol used to denote the operation of multiplication, which results in a product. While similar to a lowercase X, the form is properly a four-fold rotationally symmetric saltire.

An approximation is anything that is intentionally similar but not exactly equal to something else.

In computer programming, an assignment statement sets and/or re-sets the value stored in the storage location(s) denoted by a variable name; in other words, it copies a value into the variable. In most imperative programming languages, the assignment statement is a fundamental construct.

The equals sign or equal sign, also known as the equality sign, is the mathematical symbol =, which is used to indicate equality in some well-defined sense. In an equation, it is placed between two expressions that have the same value, or for which one studies the conditions under which they have the same value.

The backtick` is a typographical mark used mainly in computing. It is also known as backquote, grave, or grave accent.

The vertical bar, |, is a glyph with various uses in mathematics, computing, and typography. It has many names, often related to particular meanings: Sheffer stroke, pipe, bar, or, vbar, and others.

In computer science, a relational operator is a programming language construct or operator that tests or defines some kind of relation between two entities. These include numerical equality and inequalities.

String functions are used in computer programming languages to manipulate a string or query information about a string.

<span class="mw-page-title-main">JavaScript syntax</span> Set of rules defining correctly structured programs

The syntax of JavaScript is the set of rules that define a correctly structured JavaScript program.

<span class="mw-page-title-main">Mathematical operators and symbols in Unicode</span>

The Unicode Standard encodes almost all standard characters used in mathematics. Unicode Technical Report #25 provides comprehensive information about the character repertoire, their properties, and guidelines for implementation. Mathematical operators and symbols are in multiple Unicode blocks. Some of these blocks are dedicated to, or primarily contain, mathematical characters while others are a mix of mathematical and non-mathematical characters. This article covers all Unicode characters with a derived property of "Math".

In computer science, a three-way comparison takes two values A and B belonging to a type with a total order and determines whether A < B, A = B, or A > B in a single operation, in accordance with the mathematical law of trichotomy.

The less-than sign is a mathematical symbol that denotes an inequality between two values. The widely adopted form of two equal-length strokes connecting in an acute angle at the left, <, has been found in documents dated as far back as the 1560s. In mathematical writing, the less-than sign is typically placed between two values being compared and signifies that the first number is less than the second number. Examples of typical usage include 12 < 1 and −2 < 0.

A typographic approximation is a replacement of an element of the writing system with another glyph or glyphs. The replacement may be a nearly homographic character, a digraph, or a character string. An approximation is different from a typographical error in that an approximation is intentional and aims to preserve the visual appearance of the original. The concept of approximation also applies to the World Wide Web and other forms of textual information available via digital media, though usually at the level of characters, not glyphs.

Caret is the name used familiarly for the character ^ provided on most QWERTY keyboards by typing ⇧ Shift+6. The symbol has a variety of uses in programming and mathematics. The name "caret" arose from its visual similarity to the original proofreader's caret, a mark used in proofreading to indicate where a punctuation mark, word, or phrase should be inserted into a document. The formal ASCII standard (X3.64.1977) calls it a "circumflex".

References

  1. 1 2 3 Smith, Charles L. (1964). "On the origin of ">" and "<"". The Mathematics Teacher. 57 (7): 479–481. doi:10.5951/MT.57.7.0479. ISSN   0025-5769. JSTOR   27957118. Archived from the original on 2022-06-05. Retrieved 2022-06-05.
  2. 1 2 Johnson, Art. "History of Mathematical Symbols". Classic Math: History Topics for the Classroom. Dale Seymour Publications, 1994.
  3. Sherwood, Kaitlin Duck (22 October 1998). "A Beginner's Guide to Effective Email". www.webfoot.com. Archived from the original on 2021-10-14. Retrieved 2021-08-31.
  4. "Markdown Syntax Cheatsheet". Lanna Digital. Archived from the original on 2021-08-31. Retrieved 2021-08-31.
  5. "Summary of Operators". Oracle Corporation. Archived from the original on 16 April 2020. Retrieved 5 February 2020.
  6. "XML Path Language (XPath) 2.0 (Second Edition)". www.w3.org. W3C. 14 December 2010. Archived from the original on 7 October 2022. Retrieved 29 October 2019.
  7. "Greater than symbol". Archived from the original on 2023-05-18. Retrieved 2023-06-06.