Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Caret

From Wikipedia, the free encyclopedia
Typographical mark (^)
This article is about the computing character. For the proofreader's insertion symbol, seeCaret (proofreading). For other uses, seeCaret (disambiguation).Not to be confused withCarrot orCarat.
"^" and "U+005E" redirect here. For the diacritic, seecircumflex. For math notation, seeExponentiation andLogical conjunction. For similar characters sometimes called "caret"[1][2], see,λ,, andʌ.

^
Caret
In UnicodeU+005E ^CIRCUMFLEX ACCENT (^)
Different from
Different fromU+2038 CARET
U+02C6 ˆMODIFIER LETTER CIRCUMFLEX ACCENT
U+028C ʌLATIN SMALL LETTER TURNED V
U+2227 LOGICAL AND
U+039B ΛGREEK CAPITAL LETTER LAMDA
Related
See alsoU+FF3E FULLWIDTH CIRCUMFLEX ACCENT
Look upcaret in Wiktionary, the free dictionary.

Caret (from Latin caret 'there is lacking')[3] is the name used familiarly for thecharacter^ provided on mostQWERTY 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 originalproofreader's caret,, a mark used inproofreading to indicate where a punctuation mark, word, or phrase should be inserted into a document. TheASCII standard (X3.64.1977) calls it a "circumflex";[4] the Unicode standard calls it a "circumflex accent", although it is no longer practicable for that purpose.

History

[edit]

Typewriters

[edit]
Typewriter with French (AZERTY) keyboard:à,è,é,çù have dedicated keys; thecircumflex anddiaeresis accents havedead keys

On typewriters designed for languages that routinely usediacritics (accent marks), there are two possible ways to type these: keys can be dedicated toprecomposed characters (with the diacritic included); alternatively adead key 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 thatcircumflex accents could be overprinted on letters (as inô orŵ).

Transposition into ISO/IEC 646 and ASCII

[edit]

The incorporation of the circumflex symbol into ASCII is a consequence of this prior existence on typewriters: this symbol did not exist independently as atype orhot-lead printing character. The original1963 version of the ASCII standard used the code point0x5E for anup-arrow . However, the 1965ISO/IEC 646 standard defined code point0x5E as one of five available for national variation,[a] with the circumflex^ diacritic as the default and the up-arrow as one of the alternative uses.[5] In 1967, the second revision of ASCII followed suit.[6]

Caret compared to lower-case circumflex accent

Overprinting to add an accent mark was not always supported well by printers, and was almost never possible on video terminals. The freestanding circumflex (which had come to be called a caret) quickly became reused for many other purposes, such as incomputer languages and mathematical notation. As the mark did not need to fit above a letter any more, it became larger in appearance such that it can no longer be used to overprint an accent in most fonts.[7] Accented letters eventually because widely supported by adding precomposed characters[b] instead of using overprinting.

InUnicode the symbol is encoded asU+005E ^CIRCUMFLEX ACCENT; inHTML it may be used directly or inserted with^. Thecombining character for use as a diacritic isU+0302 ◌̂COMBINING CIRCUMFLEX ACCENT, althoughprecomposed characters (likeU+00E2 âLATIN SMALL LETTER A WITH CIRCUMFLEX) are available for most European languages.

Uses

[edit]

Programming languages

[edit]

The symbol^ has many uses inprogramming languages, where it is typically called a caret. It can signifyexponentiation, the bitwiseXOR operator,string concatenation[citation needed], andcontrol characters incaret notation, among other uses. Inregular expressions, 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 can transcribe the caret in the form of thetrigraph??', as the character was originally not available in all character sets and keyboards.C++ additionally supports tokens likexor (for^) andxor_eq (for^=) to avoid the character altogether.RFC 1345 recommends that the character be transcribed asdigraph'> when required.[8]

Pascal uses the caret for declaring and dereferencingpointers.InSmalltalk, the caret is the method return statement.InC++/CLI, .NET reference types are accessed through a handle using theClassName^ syntax.In Apple'sC extensions for Mac OS X and iOS, carets are used to createblocks and to denote block types.Go uses it as abitwise NOT operator.

Node.js uses the caret inpackage.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 bysemver.[9]

Surrogate symbol for superscript and exponentiation

[edit]

Inmathematics, the caret can signifyexponentiation (e.g.3^5 for35) where the usualsuperscript is not readily usable (as on somegraphing calculators). It is also used to indicate a superscript inTeX typesetting.

The use of the caret for exponentiation can be traced back toALGOL 60,[citation needed] 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 signifyhyperoperations inKnuth's up-arrow notation.

Escape character

[edit]

It is often seen incaret notation to show control characters: for instance,^A means the control character with value 1.

The Windows command-line interpreter (cmd.exe) uses the caret toescape reserved characters[citation needed] (most other shells use thebackslash). For example, to pass a 'less-than' sign as an argument to a program, one would type^<.

Upward-pointing arrow

[edit]

Ininternet forums, onsocial networking sites such as Facebook, or inonline chats, one or more carets may be used beneath the text of another post, representing an upward-pointing arrow to that post;[10] in addition to the arrow usage, it can also mean that the user who posted the ^ agrees with the above post. Multiple carets may be used to indicate that 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 simply for emphasis.

A similar use has been adopted by programming languagecompilers, such as the Java compiler, to point out where acompilation error has occurred.[citation needed] 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

[edit]

Notes

[edit]
  1. ^ISO 646 (and ASCII, which it includes) is a standard for 7-bit encoding, providing just 96 printable characters (and 32control characters). This was insufficient to meet the needs of Western European languages and so the standard specifies certaincode points that are available for national variation.
  2. ^For instance inISO Latin-1.

References

[edit]
  1. ^Unicode (1991–2012)."IPA Extensions"(PDF). Retrieved20 August 2012.
  2. ^Eric W. Weisstein."Caret".MathWorld. Wolfram. Retrieved20 August 2012.
  3. ^"Etymology of 'caret'".Online Etymology Dictionary. Douglas Harper. Retrieved22 October 2024.
  4. ^"American National Standard for Information Interchange"(PDF). National Institute for Standards. 1977. (facsimile, not machine readable)
  5. ^"Character histories: notes on some ASCII code positions (5E)".
  6. ^Tom Jennings."ASCII: American Standard Code for Information Infiltration". Archived fromthe original on 21 August 2014. Retrieved14 September 2010.
  7. ^Jukka K. Korpela (18 January 2010)."Kirjainten tarinoita"(PDF) (in Finnish). pp. 132–133. Retrieved14 September 2010.
  8. ^Simonsen, Keld (June 1992)."RFC 1345 – Character Mnemonics and Character Sets". Internet Engineering Task Force. Retrieved7 March 2022.
  9. ^"Caret ranges in node.js". Archived fromthe original on 3 December 2016. Retrieved1 October 2019.
  10. ^"What is Caret?". Computer Hope. Retrieved14 August 2012.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Caret&oldid=1262382825"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp