aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2018-03-23 13:49:58 -0700
committerPaul Eggert2018-03-23 13:51:07 -0700
commit1f2602cc5d9f2a2e94073839f2dbfa7c529c9b59 (patch)
tree24446cf4e7abdd1be4a700bf7d4d5761aa4a0656
parent582f46cbe2d53a09388e96e1c069524460f7105f (diff)
downloademacs-1f2602cc5d9f2a2e94073839f2dbfa7c529c9b59.tar.gz
emacs-1f2602cc5d9f2a2e94073839f2dbfa7c529c9b59.zip
Clarify syntax of radixed integers
* doc/lispref/numbers.texi (Integer Basics): Specify what digits are allowed in radixed integers, and that there is no initial sign or final period.
-rw-r--r--doc/lispref/numbers.texi15
1 files changed, 9 insertions, 6 deletions
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi
index f1180cf754b..c2cb6651d47 100644
--- a/doc/lispref/numbers.texi
+++ b/doc/lispref/numbers.texi
@@ -75,14 +75,17 @@ Emacs range is treated as a floating-point number.
75@cindex hex numbers 75@cindex hex numbers
76@cindex octal numbers 76@cindex octal numbers
77@cindex reading numbers in hex, octal, and binary 77@cindex reading numbers in hex, octal, and binary
78 The syntax for integers in bases other than 10 uses @samp{#} 78 The syntax for integers in bases other than 10 consists of @samp{#}
79followed by a letter that specifies the radix: @samp{b} for binary, 79followed by a radix indication followed by one or more digits. The
80@samp{o} for octal, @samp{x} for hex, or @samp{@var{radix}r} to 80radix indications are @samp{b} for binary, @samp{o} for octal,
81specify radix @var{radix}. Case is not significant for the letter 81@samp{x} for hex, and @samp{@var{radix}r} for radix @var{radix}.
82that specifies the radix. Thus, @samp{#b@var{integer}} reads 82Thus, @samp{#b@var{integer}} reads
83@var{integer} in binary, and @samp{#@var{radix}r@var{integer}} reads 83@var{integer} in binary, and @samp{#@var{radix}r@var{integer}} reads
84@var{integer} in radix @var{radix}. Allowed values of @var{radix} run 84@var{integer} in radix @var{radix}. Allowed values of @var{radix} run
85from 2 to 36. For example: 85from 2 to 36, and allowed digits are the first @var{radix} characters
86taken from @samp{0}--@samp{9}, @samp{A}--@samp{Z}.
87Letter case is ignored and there is no initial sign or final period.
88For example:
86 89
87@example 90@example
88#b101100 @result{} 44 91#b101100 @result{} 44