Less-than sign

From Wikipedia, the free encyclopedia - View original article

 
Jump to: navigation, search

The less-than sign is a sign of inequality. For example, less-than 4 would be written as "< 4"

Computing[edit]

The less-than sign (<) is an original ASCII character (hex 3C, decimal 60).

Angle brackets[edit]

The less-than sign is used for an approximation of the opening angle bracket (⟨). ASCII does not have angle brackets.

Programming language[edit]

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[edit]

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 the C++ Standard Library, operator <<, when applied on an output stream, acts as insertion operator and performs an output operation on the stream.

Triple less-than sign[edit]

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[edit]

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[edit]

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[edit]

Less-than sign is used in the spaceship operator.

HTML[edit]

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 &lt;. The less-than-or-equal-to sign may be included with &le;.

See also[edit]