diff options
author | Eli Zaretskii <eliz@gnu.org> | 2001-09-08 17:42:52 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2001-09-08 17:42:52 +0000 |
commit | d9940cbfd1b3b0fd20e5372125f8805c9b967981 (patch) | |
tree | 9f3b57b8aa4478a313ff6715c8fff0321f7efdbe /lispref | |
parent | 28932ac12458de887b55fa9baaad6e563472cb49 (diff) | |
download | emacs-d9940cbfd1b3b0fd20e5372125f8805c9b967981.tar.gz |
(Integer Basics): Document CL style read syntax for
integers in bases other than 10.
Diffstat (limited to 'lispref')
-rw-r--r-- | lispref/numbers.texi | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lispref/numbers.texi b/lispref/numbers.texi index b9ab94cfc81..9689d5cedfe 100644 --- a/lispref/numbers.texi +++ b/lispref/numbers.texi @@ -67,6 +67,18 @@ initial sign and optional final period. -0 ; @r{The integer 0.} @end example +@cindex integers in specific radix +@cindex radix for reading an integer +@cindex base for reading an integer + In addition, the Lisp reader recognizes a syntax for integers in +bases other than 10: @samp{#B@var{integer}} reads @var{integer} in +binary (radix 2), @samp{#O@var{integer}} reads @var{integer} in octal +(radix 8), @samp{#X@var{integer}} reads @var{integer} in hexadecimal +(radix 16), and @samp{#@var{radix}r@var{integer}} reads @var{integer} +in radix @var{radix} (where @var{radix} is between 2 and 36, +inclusivley). Case is not significant for the letter after @samp{#} +(@samp{B}, @samp{O}, etc.) that denotes the radix. + To understand how various functions work on integers, especially the bitwise operators (@pxref{Bitwise Operations}), it is often helpful to view the numbers in their binary form. |