Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
d9940cbf
Commit
d9940cbf
authored
Sep 08, 2001
by
Eli Zaretskii
Browse files
(Integer Basics): Document CL style read syntax for
integers in bases other than 10.
parent
28932ac1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
lispref/numbers.texi
lispref/numbers.texi
+12
-0
No files found.
lispref/numbers.texi
View file @
d9940cbf
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment