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
Octal
(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!
==Usage== ===In China=== [[File:Bagua-name-earlier.svg|right|thumb|250px|[[Fuxi]]'s "Earlier Heaven" Arrangement of the Eight Trigrams]] The eight [[bagua]] or trigrams of the [[I Ching]] correspond to octal digits: * 0 = ☷, 1 = ☳, 2 = ☵, 3 = ☱, * 4 = ☶, 5 = ☲, 6 = ☴, 7 = ☰. [[Gottfried Wilhelm Leibniz]] made the connection between trigrams, hexagrams and binary numbers in 1703.<ref>{{cite web |url=http://www.leibniz-translations.com/binary.htm |title=Explanation of binary arithmetic |last=Leibniz |first=Gottfried Wilhelm |date=1703 |website=leibniz-translations.com |access-date=2022-03-02 |archive-date=2021-02-11 |archive-url=https://web.archive.org/web/20210211112719/http://www.leibniz-translations.com/binary.htm |url-status=live }}</ref> ===By Native Americans=== * The [[Yuki language]] in [[California]] has an octal system because the speakers count using the spaces between their fingers rather than the fingers themselves.<ref>{{cite journal |jstor=2686959 |title=Ethnomathematics: A Multicultural View of Mathematical Ideas |issue=4 |pages=353–355 |author-first=Marcia |author-last=Ascher|author-link= Marcia Ascher |journal=The College Mathematics Journal|volume=23 |year=1992 |doi=10.2307/2686959 }}</ref> * The [[Pame language|Pamean languages]] in [[Mexico]] also have an octal system, because their speakers count on the knuckles of a closed fist.<ref>{{Cite journal | last=Avelino | first=Heriberto | title=The typology of Pame number systems and the limits of Mesoamerica as a linguistic area | journal=Linguistic Typology | year=2006 | volume=10 | issue=1 | pages=41–60 | url=http://linguistics.berkeley.edu/~avelino/Avelino_2006.pdf | doi=10.1515/LINGTY.2006.002 | s2cid=20412558 | access-date=2007-11-21 | archive-date=2011-06-04 | archive-url=https://web.archive.org/web/20110604174942/http://linguistics.berkeley.edu/~avelino/Avelino_2006.pdf | url-status=live }}</ref> ===By Europeans=== * It has been suggested that the reconstructed [[Proto-Indo-European|Proto-Indo-European (PIE)]] word for "nine" might be related to the PIE word for "new". Based on this, some have speculated that proto-Indo-Europeans used an octal number system, though the evidence supporting this is slim.<ref>{{cite book |last=Winter |first=Werner |chapter=Some thoughts about Indo-European numerals |title=Indo-European numerals |series=Trends in Linguistics |volume=57 |editor1-last=Gvozdanović |editor1-first=Jadranka |date=1991 |publisher=Mouton de Gruyter |location=Berlin |isbn=3-11-011322-8 |pages=13–14 |chapter-url=https://books.google.com/books?id=S-hmNOLuDGsC&pg=PA13 |access-date=2013-06-09 |archive-date=2023-04-01 |archive-url=https://web.archive.org/web/20230401131711/https://books.google.com/books?id=S-hmNOLuDGsC&pg=PA13 |url-status=live }}</ref> * In 1668, [[John Wilkins]] in ''[[An Essay towards a Real Character, and a Philosophical Language]]'' proposed use of base 8 instead of 10 "because the way of Dichotomy or Bipartition being the most natural and easie kind of Division, that Number is capable of this down to an Unite".<ref>{{cite book |last=Wilkins |first=John |title=An Essay Towards a Real Character and a Philosophical Language |date=1668 |location=London |pages=190 |url=https://books.google.com/books?id=BCCtZjBtiEYC&pg=PA190 |access-date=2015-02-08 |archive-date=2023-04-01 |archive-url=https://web.archive.org/web/20230401131651/https://books.google.com/books?id=BCCtZjBtiEYC&pg=PA190 |url-status=live }}</ref> * In 1716, King [[Charles XII of Sweden]] asked [[Emanuel Swedenborg]] to elaborate a number system based on 64 instead of 10. Swedenborg argued, however, that for people with less intelligence than the king such a big base would be too difficult and instead proposed 8 as the base. In 1718 Swedenborg wrote (but did not publish) a manuscript: "''En ny rekenkonst som om vexlas wid Thalet 8 i stelle then wanliga wid Thalet 10''" ("A new arithmetic (or art of counting) which changes at the Number 8 instead of the usual at the Number 10"). The numbers 1–7 are there denoted by the consonants l, s, n, m, t, f, u (v) and zero by the vowel o. Thus 8 = "lo", 16 = "so", 24 = "no", 64 = "loo", 512 = "looo" etc. Numbers with consecutive consonants are pronounced with vowel sounds between in accordance with a special rule.<ref>[[Donald Knuth]], ''[[The Art of Computer Programming]]''</ref> *Writing under the pseudonym "Hirossa Ap-Iccim" in ''[[The Gentleman's Magazine]]'', (London) July 1745, [[Hugh Jones (reverend)|Hugh Jones]] proposed an octal system for British coins, weights and measures. "Whereas reason and convenience indicate to us an uniform standard for all quantities; which I shall call the ''Georgian standard''; and that is only to divide every integer in each ''species'' into eight equal parts, and every part again into 8 real or imaginary particles, as far as is necessary. For tho' all nations count universally by ''tens'' (originally occasioned by the number of digits on both hands) yet 8 is a far more complete and commodious number; since it is divisible into halves, quarters, and half quarters (or units) without a fraction, of which subdivision ''ten'' is uncapable...." In a later treatise on [[Hugh Jones (reverend)#Publications|Octave computation]] (1753) Jones concluded: "Arithmetic by ''Octaves'' seems most agreeable to the Nature of Things, and therefore may be called Natural Arithmetic in Opposition to that now in Use, by Decades; which may be esteemed Artificial Arithmetic."<ref>See H. R. Phalen, "Hugh Jones and Octave Computation," ''The American Mathematical Monthly'' 56 (August–September 1949): 461-465.</ref> * In 1801, [[James Anderson of Hermiston|James Anderson]] criticized the French for basing the [[metric system]] on decimal arithmetic. He suggested base 8, for which he coined the term ''octal''. His work was intended as recreational mathematics, but he suggested a purely octal system of weights and measures and observed that the existing system of [[English units]] was already, to a remarkable extent, an octal system.<ref>James Anderson, On Octal Arithmetic [title appears only in page headers], [https://books.google.com/books?id=olhHAAAAYAAJ&pg=PA437 Recreations in Agriculture, Natural-History, Arts, and Miscellaneous Literature] {{Webarchive|url=https://web.archive.org/web/20230401131644/https://books.google.com/books?id=olhHAAAAYAAJ&pg=PA437 |date=2023-04-01 }}, Vol. IV, No. 6 (February 1801), T. Bensley, London; pages 437-448.</ref> * In the mid-19th century, Alfred B. Taylor concluded that "Our octonary [base 8] [[radix]] is, therefore, beyond all comparison the "''best possible one''" for an arithmetical system." The proposal included a graphical notation for the digits and new names for the numbers, suggesting that we should count "''un'', ''du'', ''the'', ''fo'', ''pa'', ''se'', ''ki'', ''unty'', ''unty-un'', ''unty-du''" and so on, with successive multiples of eight named "''unty'', ''duty'', ''thety'', ''foty'', ''paty'', ''sety'', ''kity'' and ''under''." So, for example, the number 65 (101 in octal) would be spoken in octonary as ''under-un''.<ref>Alfred B. Taylor, [https://archive.org/details/reportonweights00taylgoog Report on Weights and Measures], Pharmaceutical Association, 8th Annual Session, Boston, 1859-09-15. See pages 48 and 53.</ref><ref>Alfred B. Taylor, Octonary numeration and its application to a system of weights and measures, [https://books.google.com/books?id=KsAUAAAAYAAJ&pg=PA296 Proc. Amer. Phil. Soc. Vol XXIV] {{Webarchive|url=https://web.archive.org/web/20230401131638/https://books.google.com/books?id=KsAUAAAAYAAJ&pg=PA296 |date=2023-04-01 }}, Philadelphia, 1887; pages 296-366. See pages 327 and 330.</ref> Taylor also republished some of Swedenborg's work on octal as an appendix to the above-cited publications. ==={{anchor|\nnn}}In computers=== Octal became widely used in computing when systems such as the [[UNIVAC 1050]], [[PDP-8]], [[ICT 1900 series|ICL 1900]] and [[IBM mainframe]]s employed [[Six-bit character code|6-bit]], [[12-bit computing|12-bit]], [[24-bit computing|24-bit]] or [[36-bit computing|36-bit]] words. Octal was an ideal abbreviation of binary for these machines because their word size is divisible by three (each octal digit represents three binary digits). So two, four, eight or twelve digits could concisely display an entire [[Word (computer architecture)|machine word]]. It also cut costs by allowing [[Nixie tube]]s, [[seven-segment display]]s, and [[calculator]]s to be used for the operator consoles, where binary displays were too complex to use, decimal displays needed complex hardware to convert radices, and [[hexadecimal]] displays needed to display more numerals. All modern computing platforms, however, use 16-, 32-, or 64-bit words, further divided into [[octet (computing)|eight-bit bytes]]. On such systems three octal digits per byte would be required, with the most significant octal digit representing two binary digits (plus one bit of the next significant byte, if any). Octal representation of a 16-bit word requires 6 digits, but the most significant octal digit represents (quite inelegantly) only one bit (0 or 1). This representation offers no way to easily read the most significant byte, because it's smeared over four octal digits. Therefore, hexadecimal is more commonly used in programming languages today, since two hexadecimal digits exactly specify one byte. Some platforms with a power-of-two word size still have instruction subwords that are more easily understood if displayed in octal; this includes the [[PDP-11]] and [[Motorola 68000 family]]. The modern-day ubiquitous [[x86 architecture]] belongs to this category as well, but octal is rarely used on this platform, although certain properties of the binary encoding of opcodes become more readily apparent when displayed in octal, e.g. the ModRM byte, which is divided into fields of 2, 3, and 3 bits, so octal can be useful in describing these encodings. Before the availability of [[assembler (computing)|assembler]]s, some programmers would handcode programs in octal; for instance, Dick Whipple and John Arnold wrote [[Tiny BASIC|Tiny BASIC Extended]] directly in machine code, using octal.<ref>{{Cite journal |journal=[[Dr. Dobb's Journal|Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Running Light Without Overbyte]] |title=TB Code Sheet |volume=1 |issue=1 |date=December 1975}}</ref> Octal is sometimes used in computing instead of hexadecimal, perhaps most often in modern times in conjunction with [[file permissions]] under [[Unix]] systems (see [[chmod]]). It has the advantage of not requiring any extra symbols as digits (the hexadecimal system is base-16 and therefore needs six additional symbols beyond 0–9). In programming languages, octal [[literal (computer programming)|literal]]s are typically identified with a variety of [[prefix]]es, including the digit <code>0</code>, the letters <code>o</code> or <code>q</code>, the digit–letter combination <code>0o</code>, or the symbol <code>&</code><ref>{{cite book |chapter=Constants, Variables, Expressions and Operators |author=Microsoft Corporation |date=1987 |access-date=2015-12-12 |chapter-url=http://www.antonis.de/qbebooks/gwbasman/chapter%206.html |title=GW-BASIC User's Manual |url=http://www.antonis.de/qbebooks/gwbasman/ |archive-date=2016-01-05 |archive-url=https://web.archive.org/web/20160105062314/http://www.antonis.de/qbebooks/gwbasman/ |url-status=live }}</ref> or <code>$</code>. In ''Motorola convention'', octal numbers are prefixed with <code>@</code>, whereas a small (or capital<ref name="DRI_1983_CPM86-PG"/>) letter <code>o</code><ref name="DRI_1983_CPM86-PG"/> or <code>q</code><ref name="DRI_1983_CPM86-PG"/> is added as a [[suffix|postfix]] following the ''Intel convention''.<ref name="Kueveler-Schwoch_1996">{{cite book |title=Arbeitsbuch Informatik - eine praxisorientierte Einführung in die Datenverarbeitung mit Projektaufgabe |language=de |first1=Gerd |last1=Küveler |first2=Dietrich |last2=Schwoch |date=2013 |orig-year=1996 |publisher=Vieweg-Verlag, reprint: Springer-Verlag |isbn=978-3-528-04952-2 |id=978-3-32292907-5 |doi=10.1007/978-3-322-92907-5 |url=https://books.google.com/books?id=b8-dBgAAQBAJ |access-date=2015-08-05 |archive-date=2023-04-01 |archive-url=https://web.archive.org/web/20230401131645/https://books.google.com/books?id=b8-dBgAAQBAJ |url-status=live }}</ref><ref name="Kueveler-Schwoch_2007">{{cite book |title=Informatik für Ingenieure und Naturwissenschaftler: PC- und Mikrocomputertechnik, Rechnernetze |language=de |first1=Gerd |last1=Küveler |first2=Dietrich |last2=Schwoch |date=2007-10-04 |publisher=Vieweg, reprint: Springer-Verlag |edition=5 |volume=2 |isbn=978-3-83489191-4 |id=978-3-83489191-4 |url=https://books.google.com/books?id=xQbvPYxceY0C |access-date=2015-08-05 |archive-date=2023-04-01 |archive-url=https://web.archive.org/web/20230401131639/https://books.google.com/books?id=xQbvPYxceY0C |url-status=live }}</ref> In [[Concurrent DOS]], [[Multiuser DOS]] and [[REAL/32]] as well as in [[DOS Plus]] and [[DR-DOS]] various [[environment variable]]s like [[%$CLS%|$CLS]], [[%$ON%|$ON]], [[%$OFF%|$OFF]], [[%$HEADER%|$HEADER]] or [[%$FOOTER%|$FOOTER]]<!-- not all variables are supported by all of the mentioned OSes --> support an <code>\nnn</code> octal number notation,<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_2002_CLS"/><ref name="CCI_1997_HELP"/> and DR-DOS [[DEBUG]] utilizes <code>\</code> to prefix octal numbers as well. For example, the literal 73 (base 8) might be represented as <code>073</code>, <code>o73</code>, <code>q73</code>, <code>0o73</code>, <code>\73</code>, <code>@73</code>, <code>&73</code>, <code>$73</code> or <code>73o</code> in various languages. Newer languages have been abandoning the prefix <code>0</code>, as decimal numbers are often represented with leading zeroes. The prefix <code>q</code> was introduced to avoid the prefix <code>o</code> being mistaken for a zero, while the prefix <code>0o</code> was introduced to avoid starting a numerical literal with an alphabetic character (like <code>o</code> or <code>q</code>), since these might cause the literal to be confused with a variable name. The prefix <code>0o</code> also follows the model set by the prefix <code>0x</code> used for hexadecimal literals in the [[C (programming language)|C language]]; it is supported by [[Haskell (programming language)|Haskell]],<ref>{{cite web| url = https://www.haskell.org/onlinereport/lexemes.html#sect2.5| title = Haskell 98 Lexical Structure| access-date = 2019-11-01 | archive-date = 2021-04-11 | archive-url = https://web.archive.org/web/20210411061515/https://www.haskell.org/onlinereport/lexemes.html#sect2.5| url-status = live}}</ref> [[OCaml]],<ref>OCaml: [http://caml.inria.fr/pub/docs/manual-ocaml/lex.html 7.1 Lexical conventions] {{Webarchive|url=https://archive.today/20130701170755/http://caml.inria.fr/pub/docs/manual-ocaml/lex.html |date=2013-07-01 }}</ref> [[Python (programming language)|Python]] as of version 3.0,<ref>Python 3: https://docs.python.org/3.1/reference/lexical_analysis.html#integer-literals {{Webarchive|url=https://web.archive.org/web/20140320021754/http://docs.python.org/3.1/reference/lexical_analysis.html#integer-literals |date=2014-03-20 }}</ref> [[Raku (programming language)|Raku]],<ref>Perl 6: http://perlcabal.org/syn/S02.html#Radix_markers {{Webarchive|url=https://web.archive.org/web/20141031161348/http://perlcabal.org/syn/S02.html#Radix_markers |date=31 October 2014 }}</ref> [[Ruby (programming language)|Ruby]],<ref>RubySpec: https://github.com/ruby/ruby/blob/master/spec/ruby/core/string/to_i_spec.rb {{Webarchive|url=https://web.archive.org/web/20220529183751/https://github.com/ruby/ruby/blob/master/spec/ruby/core/string/to_i_spec.rb |date=2022-05-29 }}</ref> [[Tcl]] as of version 9,<ref>Tcl: http://wiki.tcl.tk/498 {{Webarchive|url=https://web.archive.org/web/20140104045014/http://wiki.tcl.tk/498 |date=2014-01-04 }}</ref> [[PHP]] as of version 8.1,<ref>PHP.Watch - PHP 8.1: Explicit Octal numeral notation https://php.watch/versions/8.1/explicit-octal-notation {{Webarchive|url=https://web.archive.org/web/20210108032852/https://php.watch/versions/8.1/explicit-octal-notation |date=2021-01-08 }}</ref> [[Rust (programming language)|Rust]]<ref>Rust literals and operators: https://doc.rust-lang.org/rust-by-example/primitives/literals.html {{Webarchive|url=https://web.archive.org/web/20220528081546/https://doc.rust-lang.org/rust-by-example/primitives/literals.html |date=2022-05-28 }}</ref> and [[ECMAScript]] as of ECMAScript 6<ref>ECMAScript 6th Edition draft: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-numeric-literals {{Webarchive|url=https://web.archive.org/web/20131216202526/https://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-numeric-literals |date=16 December 2013 }}</ref> (the prefix <code>0</code> originally stood for base 8 in [[JavaScript]] but could cause confusion,<ref>{{cite web |url=https://stackoverflow.com/questions/5600366/why-does-the-radix-for-javascripts-parseint-default-to-8 |title=Why does the radix for JavaScript's parseInt default to 8? |date=8 April 2011 |work=Stack Overflow |access-date=2019-08-21 |archive-date=2020-08-06 |archive-url=https://web.archive.org/web/20200806000322/https://stackoverflow.com/questions/5600366/why-does-the-radix-for-javascripts-parseint-default-to-8 |url-status=live }}</ref> therefore it has been discouraged in ECMAScript 3 and dropped in ECMAScript 5<ref>{{citation |work=Mozilla Developer Network (MDN) |title=parseInt() |url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt |quote=If the input string begins with "0" (a zero), radix is assumed to be 8 (octal) or 10 (decimal). Exactly which radix is chosen is implementation-dependent. ECMAScript 5 clarifies that 10 (decimal) should be used, but not all browsers support this yet |access-date=2014-01-03 |archive-date=2014-03-05 |archive-url=https://web.archive.org/web/20140305220352/https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt |url-status=live }}</ref>). Octal numbers that are used in some programming languages (C, [[Perl]], [[PostScript]]...) for textual/graphical representations of byte strings when some byte values (unrepresented in a code page, non-graphical, having special meaning in current context or otherwise undesired) have to be to [[escape character|escaped]] as <code>\nnn</code>. Octal representation may be particularly handy with non-ASCII bytes of [[UTF-8]], which encodes groups of 6 bits, and where any start byte has octal value <code>\3nn</code> and any continuation byte has octal value <code>\2nn</code>. Octal was also used for [[Floating-point arithmetic|floating point]] in the [[Ferranti Atlas]] (1962), [[Burroughs B5500]] (1964), [[Burroughs B5700]] (1971), [[Burroughs B6700]] (1971) and [[Burroughs B7700]] (1972) computers.<!-- list from note NB_9 in [[Floating-point arithmetic]] --> === In aviation === [[Transponder (aeronautics)|Transponders]] in aircraft transmit a "squawk" [[Transponder (aeronautics)#Transponder codes|code]], expressed as a four-octal-digit number, when interrogated by ground radar. This code is used to distinguish different aircraft on the radar screen.
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)