HOME

TheInfoList



OR:

Caret is the name used familiarly for the
character Character or Characters may refer to: Arts, entertainment, and media Literature * ''Character'' (novel), a 1936 Dutch novel by Ferdinand Bordewijk * ''Characters'' (Theophrastus), a classical Greek set of character sketches attributed to The ...
, provided on most
QWERTY QWERTY () is a keyboard layout for Latin-script alphabets. The name comes from the order of the first six keys on the top left letter row of the keyboard ( ). The QWERTY design is based on a layout created for the Sholes and Glidden t ...
keyboards by typing . 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 ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
standard (X3.64.1977) calls it a " circumflex".


History


Typewriters

On typewriters designed for languages that routinely use
diacritic A diacritic (also diacritical mark, diacritical point, diacritical sign, or accent) is a glyph added to a letter or to a basic glyph. The term derives from the Ancient Greek (, "distinguishing"), from (, "to distinguish"). The word ''diacriti ...
s (accent marks), there are two possible ways to type these. Keys can be dedicated to
precomposed character A precomposed character (alternatively composite character or decomposable character) is a Unicode entity that can also be defined as a sequence of one or more other characters. A precomposed character may typically represent a letter with a diacri ...
s (with the diacritic included) or alternatively a
dead key A dead key is a special kind of modifier key on a mechanical typewriter, or computer keyboard, that is typically used to attach a specific diacritic to a base letter. The dead key does not generate a (complete) character by itself, but modifies t ...
mechanism can be provided. With the latter, a mark is made when a dead key is typed but, unlike normal keys, the paper carriage does not move on and thus the next letter to be typed is printed under the accent. The symbol was originally provided in typewriters and computer printers so that circumflex accents could be overprinted on letters (as in or ).


Transposition into ISO/IEC 646 and ASCII

The incorporation of the circumflex symbol into ASCII is a consequence of this prior existence on typewriters. This symbol did not exist independently as a type or hot-lead printing character. The original 1963 version of the ASCII standard used the code point x5E for an . However, the 1965 ISO/IEC646 standard defined code-point x5E as one of five available for national variation, with the circumflex diacritic as the default and the up-arrow as one of the alternative uses. In 1967, the second revision of ASCII followed suit. Overprinting to add an accent mark was not always supported well by printers, and was almost never possible on video terminals. Instead precomposed characters were eventually created to show the accented letters. The freestanding circumflex (which had become to be called a caret) quickly became reused for many other purposes, such as in
computer language A computer language is a formal language used to communicate with a computer. Types of computer languages include: * Construction language – all forms of communication by which a human can specify an executable problem solution to a comput ...
s and mathematical notation. As the mark did not need to fit above a letter anymore, it became larger in appearance such that it can no longer be used to overprint an accent. In
Unicode Unicode, formally The Unicode Standard,The formal version reference is is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems. The standard, wh ...
it is encoded as and in
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaSc ...
may be inserted with . This caret is not to be confused with other chevron-shaped characters, such as the turned v or the
logical AND In logic, mathematics and linguistics, And (\wedge) is the truth-functional operator of logical conjunction; the ''and'' of a set of operands is true if and only if ''all'' of its operands are true. The logical connective that represents this ...
, which may occasionally be called carets.


Uses


Programming languages

The symbol has many uses in
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
s, where it is typically called a caret. It can signify
exponentiation Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to r ...
, the bitwise XOR operator,
string concatenation In formal language theory and computer programming, string concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball". In certain formalisations of concatenati ...
, and
control character In computing and telecommunication, a control character or non-printing character (NPC) is a code point (a number) in a character set, that does not represent a written symbol. They are used as in-band signaling to cause effects other than the ...
s in
caret notation Caret notation is a notation for control characters in ASCII. The notation assigns to control-code 1, sequentially through the alphabet to assigned to control-code 26 (0x1A). For the control-codes outside of the range 1–26, the ...
, among other uses. In
regular expression A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" ...
s, the caret is used to match the beginning of a string or line; if it begins a character class, then the inverse of the class is to be matched.
ANSI C ANSI C, ISO C, and Standard C are successive standards for the C programming language published by the American National Standards Institute (ANSI) and ISO/IEC JTC 1/SC 22/WG 14 of the International Organization for Standardization (ISO) and th ...
can transcribe the caret in the form of the trigraph , as the character was originally not available in all character sets and keyboards.
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
additionally supports tokens like (for ) and (for ) to avoid the character altogether. recommends that the character be transcribed as digraph when required. Pascal uses the caret for declaring and dereferencing pointers. In Smalltalk, the caret is the method return statement. In
C++/CLI C++/CLI is a variant of the C++ programming language, modified for Common Language Infrastructure. It has been part of Visual Studio 2005 and later, and provides interoperability with other .NET languages such as C#. Microsoft created C++/CLI ...
, .NET reference types are accessed through a handle using the syntax. In Apple's C extensions for Mac OS X and iOS, carets are used to create blocks and to denote block types. Go uses it as a
bitwise NOT In computer programming, a bitwise operation operates on a bit string, a bit array or a binary numeral (considered as a bit string) at the level of its individual bits. It is a fast and simple action, basic to the higher-level arithmetic operat ...
operator.
Node.js Node.js is an open-source server environment. Node.js is cross-platform and runs on Windows, Linux, Unix, and macOS. Node.js is a back-end JavaScript runtime environment. Node.js runs on the V8 JavaScript Engine and executes JavaScript code o ...
uses the caret in package.json files to signify dependency resolution behavior being used for each particular dependency. In the case of Node.js, a caret allows any kind of update, unless it is seen as a "major" update as defined by semver.


Surrogate symbol for superscript and exponentiation

In mathematics, the caret can signify
exponentiation Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to r ...
(3^5 for ), where the usual superscript is not readily usable (as on some
graphing calculator A graphing calculator (also graphics calculator or graphic display calculator) is a handheld computer that is capable of plotting graphs, solving simultaneous equations, and performing other tasks with variables. Most popular graphing calcu ...
s). It is also used to indicate a superscript in
TeX Tex may refer to: People and fictional characters * Tex (nickname), a list of people and fictional characters with the nickname * Joe Tex (1933–1982), stage name of American soul singer Joseph Arrington Jr. Entertainment * ''Tex'', the Italian ...
typesetting. As Isaac Asimov described it in his 1974 "''Skewered!''" essay (on
Skewes' number In number theory, Skewes's number is any of several large numbers used by the South African mathematician Stanley Skewes as upper bounds for the smallest natural number x for which :\pi(x) > \operatorname(x), where is the prime-counting function ...
), "I make the exponent a figure of normal size and it is as though it is being held up by a lever, and its added weight when its size grows bends the lever down." The use of the caret for exponentiation can be traced back to ALGOL 60, which expressed the exponentiation operator as an upward-pointing arrow, intended to evoke the superscript notation common in mathematics. The upward-pointing arrow is now used to signify hyperoperations in
Knuth's up-arrow notation In mathematics, Knuth's up-arrow notation is a method of notation for very large integers, introduced by Donald Knuth in 1976. In his 1947 paper, R. L. Goodstein introduced the specific sequence of operations that are now called ''hyperoperati ...
.


Escape character

Often seen as
caret notation Caret notation is a notation for control characters in ASCII. The notation assigns to control-code 1, sequentially through the alphabet to assigned to control-code 26 (0x1A). For the control-codes outside of the range 1–26, the ...
to show control characters, for instance means the control character with value 1. The command-line interpreter,
cmd.exe Command Prompt, also known as cmd.exe or cmd, is the default command-line interpreter for the OS/2, eComStation, ArcaOS, Microsoft Windows (Windows NT family and Windows CE family), and ReactOS operating systems. On Windows CE .NET 4.2, Windo ...
, of Windows uses the caret to escape reserved characters (most other shells use the
backslash The backslash is a typographical 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. History , efforts to identify either the origin of ...
). For instance to pass a less-than sign as an argument to a program you type .


Upwards-pointing arrow

In
internet forum An Internet forum, or message board, is an online discussion site where people can hold conversations in the form of posted messages. They differ from chat rooms in that messages are often longer than one line of text, and are at least temporar ...
s,
social networking sites A social networking service or SNS (sometimes called a social networking site) is an online platform which people use to build social networks or social relationships with other people who share similar personal or career content, interests, act ...
such as Facebook, or in
online chat Online chat may refer to any kind of communication over the Internet that offers a real-time transmission of text messages from sender to receiver. Chat messages are generally short in order to enable other participants to respond quickly. Ther ...
s, one or more carets may be used beneath the text of another post, representing an upwards-pointing arrow to that post. In addition to the arrow usage, it can also mean that the user who posted the ^ agrees with the above post. Multiple carets may indicate the comment is replying to or relating to the post above that correlates with the number of carets used, or to "underscore" the correct portion of the previous post, or may simply be used for emphasis. A similar use has been adopted by programming language
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
s such as Java compiler to point out where a
compilation error Compilation error refers to a state when a compiler fails to compile a piece of computer program source code, either due to errors in the code, or, more unusually, due to errors in the compiler itself. A compilation error message often helps program ...
has occurred. The compiler prints out the faulty line of code and uses a single caret on the next line, padded by spaces, to give a visual indication of the error location.


See also

*
Caret Caret is the name used familiarly for the character , provided on most QWERTY keyboards by typing . The symbol has a variety of uses in programming and mathematics. The name "caret" arose from its visual similarity to the original proofreade ...
as used in proofreading and
typography Typography is the art and technique of arranging type to make written language legible, readable and appealing when displayed. The arrangement of type involves selecting typefaces, point sizes, line lengths, line-spacing ( leading), ...
*
Hat operator The hat operator is a mathematical notation with various uses in different branches of science and mathematics. Estimated value In statistics, a circumflex (ˆ), called a "hat", is used to denote an estimator or an estimated value. For example, ...
, a notation used in mathematics and statistics, is sometimes called a caret


Notes


References

{{Reflist, refs= Isaac Asimov (1974), "Skewered", ''Of Matters Great and Small'', Doubleday, {{ISBN, 978-0385022255 {{cite web , title = What is Caret? , url = http://www.computerhope.com/jargon/c/caret.htm , publisher = Computer Hope, access-date = 14 August 2012 {{cite web , url = http://www.worldpowersystems.com/projects/codes/index.html#UP , title = ASCII: American Standard Code for Information Infiltration , author = Tom Jennings , access-date = 14 September 2010 , archive-url = https://web.archive.org/web/20140821121342/http://www.worldpowersystems.com/projects/codes/index.html#UP , archive-date = 21 August 2014 , url-status = dead {{cite web, url = https://jkorpela.fi/kirjaimet/tarinoita.pdf , title = Kirjainten tarinoita , author = Jukka K. Korpela , pages = 132–133 , date = 18 January 2010 , access-date = 14 September 2010 , language = fi {{cite web , url = http://unicode.org/charts/PDF/U0250.pdf , title = IPA Extensions , author = Unicode , date = 1991–2012 , access-date = 20 August 2012 {{cite web , url = http://mathworld.wolfram.com/Caret.html , title = Caret , author = Eric W. Weisstein , work = MathWorld , publisher = Wolfram , access-date = 20 August 2012 Typographical symbols