( ) | { } | ⟨ ⟩ |
---|---|---|
Parentheses | Braces or curly brackets | Chevrons or angle brackets |
再者,這兩個符號也以用於數學裡的 大於 及小於 符號。其用法如下:
Less-than sign
The less-than sign is a sign of inequality. For example, less-than 4 would be written as "< 4"
Contents
Computing
The less-than sign (<) is an original ASCII character (hex 3C, decimal 60).
Angle brackets
The less-than sign is used for an approximation of the opening angle bracket (⟨). ASCII does not have angle brackets.
Programming language
In BASIC, Lisp-family languages, and C-family languages (including Java and C++), operator < means "less than".
In Coldfusion, operator .lt. means "less than".
In Fortran, operator .LT. means "less than"; later versions allow <.
In Bourne shell, operator -lt means "less than".
Double less-than sign
The double less-than sign (<<) is used for an approximation of the much-less-than sign (≪). ASCII does not have much-less-than sign.
The double less-than sign (<<) is used for an approximation of the opening guillemet («). ASCII does not have guillemets.
In Bash, Perl, and Ruby, operator <<EOF (where "EOF" is an arbitrary string, but commonly "EOF" denoting "end of file") is used to denote the beginning of a here document.
In C and C++, operator << represents a binary left shift.
In C++, operator <<, when applied on an output stream, acts as insertion operator and performs an output operation on the stream.
Triple less-than sign
In PHP, operator <<<OUTPUT is used to denote the beginning of a heredoc statement (where OUTPUT is an arbitrary named variable.)
Less-than sign plus equals sign
The less-than sign plus the equals sign (<=) is used for an approximation of the less-than-or-equal-to sign (≤). ASCII does not have less-than-or-equal-to sign.
In BASIC, Lisp-family languages, and C-family languages (including Java and C++), operator <= means "less than or equal to".
In Fortran, operator .LE. means "less than or equal to".
In Bourne shell and Windows PowerShell, operator -le means "less than or equal to".
Shell scripts
In Bourne shell (and many other shells), less-than sign is used to redirect input from a file. Less-than plus ampersand (<&) is used to redirect from a file descriptor.
Spaceship operator
Less-than sign is used in the spaceship operator.
HTML
In HTML (and SGML and XML), the less-than sign is used at the beginning of tags. The less-than sign may be included with <
. The less-than-or-equal-to sign may be included with ≤
.
See also
Greater-than sign
This article has no lead section. (October 2012) |
The greater-than symbol is used in various operations that usually pertain to work being done mathematically or with a programming language. The symbol looks similar to a sideways V and has been used in recorded literature as old as the 1560s. Generally, the symbol is used to show inequality between two numbers or expressions. In mathematics, if there are two numbers being looked at as an inequality, the greater-than symbol usually goes in between the two and the open end is pointed towards the larger number to symbolize that it is a number greater than the other (For example: 4 > 2 or 100 < 102). There are other combinations of the greater-than symbol and the 'equals' symbol or the greater-than symbol beside another greater-than symbol that are also used mathematically and computationally.
Contents
History
The symbols < and > first appear in Artis Analyticae Praxis ad Aequationes Algebraicas Resolvendas (The Analytical Arts Applied to Solving Algebraic Equations) by Thomas Harriot (1560-1621), which was published posthumously in 1631: "Signum majoritatis ut a > b significet a majorem quam b" and "Signum minoritatis ut a < b significet a minorem quam b."
According to Johnson (page 144), while Harriot was surveying North America, he saw a native American with a symbol that resembled the greater than symbol both backwards and forwards ( > and < ) . Johnson says it is likely he developed the two symbols from this symbol.
Computing
The greater-than sign (>) is an original ASCII character (hex 3E, decimal 62).
Angle brackets
The greater-than sign is used for an approximation of the closing angle bracket (⟩). ASCII does not have (angular brackets).
Programming language
BASIC and C-family languages, (including Java and C++) use the 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". It basically means this sign > is greater than and this sign < is less 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 (»). ASCII does not have guillemets.
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.
Greater-than sign plus equals sign
The greater-than sign plus the equals sign (>=) is used for an approximation of the greater than or equal to sign (≥). ASCII does not have greater-than-or-equal-to sign.
In BASIC, Lisp-family languages, and C-family languages (including Java and C++), operator >= means "greater than or equal to".
In Fortran, operator .GE. means "greater than or equal to".
Example: 5 > 2 means 5 is greater than 2. 6 < 9 means 6 is less than 9.
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.
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.
Electronic mail
The greater-than sign is used to denote quotations in the e-mail and newsgroup formats, and this has been taken into use also in forums.
留言列表