Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Number sign
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Computing === * In [[Unicode]] and [[ASCII]], the symbol has a [[code point]] as {{unichar|0023}} and [[entity code]] {{code|#}} in [[HTML5]].<ref>HTML5 is the only version of HTML that has a named entity for the number sign, see https://www.w3.org/TR/html4/sgml/entities.html {{Webarchive|url=https://web.archive.org/web/20180401051616/http://www.w3.org/TR/html4/sgml/entities.html |date=2018-04-01 }} ("The following sections present the complete lists of character entity references.") and https://www.w3.org/TR/2014/CR-html5-20140731/syntax.html#named-character-references {{Webarchive|url=https://web.archive.org/web/20170805013240/http://www.w3.org/TR/2014/CR-html5-20140731/syntax.html#named-character-references |date=2017-08-05 }} ("num;").</ref> * In many scripting languages and data file formats, especially ones that originated on Unix, {{code|#}} introduces a comment that goes to the end of the line.<ref name="hash character">{{cite web |title=CSS Syntax and Selectors |url=https://www.w3schools.com/css/css_syntax.asp |website=W3Schools |access-date=2019-07-15 |archive-date=2019-07-12 |archive-url=https://web.archive.org/web/20190712051145/https://www.w3schools.com/css/css_syntax.asp |url-status=live }}</ref> The combination {{code|#!}} at the start of an executable file is a "[[Shebang (Unix)|shebang]]", "hash-bang" or "pound-bang", used to tell the operating system which program to use to run the script (see [[Magic number (programming)|magic number]]). This combination was chosen so it would be a comment in the scripting languages. ** {{code|#!}} is the symbol of the CrunchBang Linux distribution. * In the [[Perl]] programming language, {{code|#}} is used as a modifier to array syntax to return the index number of the last element in the [[Array data type|array]], e.g., an array's last element is at {{code|$array[$#array]}}. The number of elements in the array is {{code|$#array + 1}}, since Perl arrays default to using zero-based indices. If the array has not been defined, the return is also undefined. If the array is defined but has not had any elements assigned to it, e.g., {{code|1=@array = ()}}, then {{code|$#array}} returns {{code|β1}}. See the section on [[Perl language structure#Array functions|Array functions]] in the Perl language structure article. * In both the [[C preprocessor|C]] and [[C++]] preprocessors, as well as in other syntactically C-like languages, {{code|#}} is used to start a preprocessor [[Directive (programming)|directive]]. Inside macros, after {{code|#define}}, it is used for various purposes; for example, the double pound (hash) sign {{code|##}} is used for token [[concatenation]]. * In [[Unix shell]]s, {{code|#}} is placed by convention at the end of a [[command prompt]] to denote that the user is working as [[Superuser|root]]. * {{code|#}} is used in a [[URL]] of a [[web page]] or other resource to introduce a "[[fragment identifier]]" β an id which defines a position within that resource. In HTML, this is known as an [[HTML element#Anchor|anchor link]]. For example, in the URL {{code|https://en.wikipedia.org/wiki/Number_sign#Computing}} the portion after the {{code|#}} ({{code|Computing}}) is the fragment identifier, in this case denoting that the display should be moved to show the tag marked by {{code|1=<span id="Computing">...</span>|2=html}} in the HTML.<ref>{{cite web|url=http://www.w3.org/TR/html4/intro/intro.html#fragment-uri|title=Introduction to HTML|access-date=16 September 2014|archive-date=16 August 2008|archive-url=https://web.archive.org/web/20080816014507/http://www.w3.org/TR/html4/intro/intro.html#fragment-uri|url-status=live}}</ref> * [[Internet Relay Chat]]: on (IRC) servers, {{code|#}} precedes the name of every [[IRC channels|channel]] that is available across an entire IRC network. * In [[blog]]s, {{code|#}} is sometimes used to denote a [[permalink]] for that particular weblog entry. * In [[lightweight markup language]]s, such as [[wiki]]text, {{code|#}} is often used to introduce numbered list items. * {{code|#}} is used in the [[Modula-2]] and [[Oberon (programming language)|Oberon]] programming languages designed by [[Niklaus Wirth]] and in the [[Component Pascal]] language derived from Oberon to denote the ''not equal'' symbol, as a stand-in for the mathematical unequal sign {{char|β }}, being more intuitive than {{code|<>}} or {{code|1=!=}}. For example: {{nowrap|{{code|IF i # 0 THEN ...|cp}}}} * In [[Rust (programming language)|Rust]], {{code|#}} is used for attributes such as in {{code|#[test]}}. * In [[OCaml]], {{code|#}} is the operator used to call a method. * In [[Common Lisp]],<ref>{{cite web|url=http://www.lispworks.com/documentation/HyperSpec/Body/02_dh.htm|title=Lispworks.com|access-date=16 September 2014|archive-date=10 October 2014|archive-url=https://web.archive.org/web/20141010014731/http://www.lispworks.com/documentation/HyperSpec/Body/02_dh.htm|url-status=live}}</ref> {{code|#}} is a dispatching [[Lisp reader|read macro]] character used to extend the [[S-expression]] syntax with short cuts and support for various data types ([[complex number]]s, vectors and more). * In [[Scheme (programming language)|Scheme]], {{code|#}} is the prefix for certain syntax with special meaning. * In [[Standard ML]], {{code|#}}, when prefixed to a field name, becomes a projection function (function to access the field of a record or tuple); also, {{code|#}} prefixes a [[string literal]] to turn it into a character literal. * In [[Wolfram Mathematica|Mathematica]] syntax, {{code|#}}, when used as a variable, becomes a pure function (a placeholder that is mapped to any variable meeting the conditions). * In [[LaTeX]], {{code|#}}, when prefixing a number, references an arguments for a user defined command. For instance <syntaxhighlight lang="tex" inline>\newcommand{\code}[1]{\texttt{#1}}</syntaxhighlight>. * In [[Javadoc]],<ref>{{cite web|url=http://download.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#@see|title=Oracle.com|access-date=16 September 2014|archive-date=28 October 2011|archive-url=https://web.archive.org/web/20111028092204/http://download.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#@see|url-status=live}}</ref> {{code|#}} is used with the {{code|@see}} tag to introduce or separate a field, constructor, or method member from its containing class. * In [[Core War|Redcode]] and some other dialects of [[assembly language]], {{code|#}} is used to denote immediate mode addressing, e.g., {{code|LDA #10}}, which means "load accumulator A with the value 10" in [[MOS 6502]] assembly language. * in [[HTML]], [[Cascading Style Sheets|CSS]], [[Scalable Vector Graphics|SVG]], and other computing applications {{code|#}} is used to identify a color specified in [[hexadecimal]] format, e.g., {{code|#FFAA00}}. This usage comes from [[X11]] color specifications, which inherited it from early assembler dialects that used {{code|#}} to prefix hexadecimal constants, e.g.: ZX Spectrum [[Zilog Z80|Z80]] assembly.<ref>{{cite web|url=http://www.worldofspectrum.org/pub/sinclair/games-info/h/HiSoftDevpacV3.pdf|title=HISOFT DEVPAC ZX Spectrum Programmer's Manual|website=worldofspectrum.org|access-date=2017-10-03|archive-date=2018-11-12|archive-url=https://web.archive.org/web/20181112231113/http://www.worldofspectrum.org/pub/sinclair/games-info/h/HiSoftDevpacV3.pdf|url-status=live}}</ref> * In [[Be-Music Script]], every command line starts with {{code|#}}. Lines starting with characters other than "#" are treated as comments. * The use of the hash symbol in a [[hashtag]] is a phenomenon conceived by [[Chris Messina (open-source advocate)|Chris Messina]], and popularized by social media network [[Twitter]], as a way to direct conversations and topics amongst users. This has led to an increasingly common tendency to refer to the symbol itself as "hashtag".<ref name="Time">{{Cite magazine|url=https://time.com/2870942/hashtag-oed-oxford-english-dictionary/|title=You'll Never Guess the Real Name for a Hashtag|last=Nicks|first=Denver|date=June 13, 2014|magazine=TIME|access-date=May 5, 2016|archive-date=May 11, 2016|archive-url=https://web.archive.org/web/20160511235410/http://time.com/2870942/hashtag-oed-oxford-english-dictionary/|url-status=live}}</ref> * In programming languages like PL/1 and Assembler used on IBM mainframe systems, as well as JCL (Job Control Language), the {{code|#}} (along with {{code|$}} and {{code|@}}) are used as additional letters in identifiers, labels and data set names. * In [[J (programming language)|J]], {{code|#}} is the ''Tally'' or ''Count'' function,<ref>{{cite web|url=https://code.jsoftware.com/wiki/Vocabulary/number|title=Vocabulary/number|access-date=November 20, 2019|website=J NuVoc|archive-date=February 14, 2020|archive-url=https://web.archive.org/web/20200214105150/https://code.jsoftware.com/wiki/Vocabulary/number|url-status=live}}</ref> and similarly in [[Lua (programming language)|Lua]], {{code|#}} can be used as a shortcut to get the length of a table, or get the length of a string. Due to the ease of writing "#" over longer function names, this practice has become standard in the Lua community. * In Dyalog [[APL (programming language)|APL]], {{code|#}} is a reference to the root [[namespace]] while {{code|##}} is a reference to the current space's parent namespace. * In [[Ada (programming language)|Ada]], the {{code|#}} character is used in based integer literals, which take the form {{code|base#digits#}}, where {{code|base}} is an integer from 2 to 16 specifying the radix, and {{code|digits}} are the digits valid in that base (0-9, optionally A-F for bases above 10).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)