# HG changeset patch # User Eli Zaretskii # Date 999970972 0 # Node ID 634358ff84a43031e7c62de71e963368ea0e51d2 # Parent f56fa34012c09ac51365f3e4162520ae38407f57 (Integer Basics): Document CL style read syntax for integers in bases other than 10. diff -r f56fa34012c0 -r 634358ff84a4 lispref/numbers.texi --- a/lispref/numbers.texi Sat Sep 08 17:42:16 2001 +0000 +++ b/lispref/numbers.texi Sat Sep 08 17:42:52 2001 +0000 @@ -67,6 +67,18 @@ -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.