aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2009-12-15 00:58:26 +0000
committerJay Belanger2009-12-15 00:58:26 +0000
commit0e9833273dc900ac826c8b8be9f09997bde43117 (patch)
tree1a6c055d343876d01501b364536e082f74f25574
parentfd47199325ddfe6fe99bffe7e410bf5d32865e7c (diff)
downloademacs-0e9833273dc900ac826c8b8be9f09997bde43117.tar.gz
emacs-0e9833273dc900ac826c8b8be9f09997bde43117.zip
(Radix Modes): Clarify two's complement notation.
-rw-r--r--doc/misc/ChangeLog4
-rw-r--r--doc/misc/calc.texi34
2 files changed, 22 insertions, 16 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 0e467c22d61..b71b6ccd0c6 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,7 @@
12009-12-15 Jay Belanger <jay.p.belanger@gmail.com>
2
3 * calc/calc.texi (Radix Modes): Clarify two's complement notation.
4
12009-12-14 Chong Yidong <cyd@stupidchicken.com> 52009-12-14 Chong Yidong <cyd@stupidchicken.com>
2 6
3 * sem-user.texi (Semantic mode, Idle Scheduler, Smart Completion) 7 * sem-user.texi (Semantic mode, Idle Scheduler, Smart Completion)
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index cb29d8bcbfb..748268b2ed2 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -13173,34 +13173,36 @@ are displayed with at least enough digits to represent
13173in the current radix. (Larger integers will still be displayed in their 13173in the current radix. (Larger integers will still be displayed in their
13174entirety.) 13174entirety.)
13175 13175
13176 13176@cindex Two's complements
13177Calc can display @expr{w}-bit integers using two's complement notation 13177With the binary, octal and hexadecimal display modes, Calc can
13178and binary, octal or hexadecimal display radix with the commands 13178display @expr{w}-bit integers using two's complement notation. These
13179@kbd{C-u d 2}, @kbd{C-u d 8} or @kbd{C-u d 6}, respectively. In this 13179versions of the display radices are selected with the key sequences
13180case a negative word size might be appropriate (@pxref{Binary Functions}). 13180@kbd{C-u d 2}, @kbd{C-u d 8} and @kbd{C-u d 6}, respectively.
13181The integers in the symmetric interval from 13181In these cases a negative word size might be appropriate
13182(@pxref{Binary Functions}). In two's complement notation, the integers
13183in the (nearly) symmetric interval from
13182@texline @math{-2^{w-1}} 13184@texline @math{-2^{w-1}}
13183@infoline @expr{-2^(w-1)} 13185@infoline @expr{-2^(w-1)}
13184to 13186to
13185@texline @math{2^{w-1}-1} 13187@texline @math{2^{w-1}-1}
13186@infoline @expr{2^(w-1)-1} 13188@infoline @expr{2^(w-1)-1}
13187will be represented by using the integers from @expr{0} to @expr{2^w}; 13189are represented by the integers from @expr{0} to @expr{2^w-1}:
13188the integers from @expr{0} to 13190the integers from @expr{0} to
13189@texline @math{2^{w-1}-1} 13191@texline @math{2^{w-1}-1}
13190@infoline @expr{2^(w-1)-1} 13192@infoline @expr{2^(w-1)-1}
13191will be represented by themselves and the integers 13193are represented by themselves and the integers from
13192from
13193@texline @math{-2^{w-1}} 13194@texline @math{-2^{w-1}}
13194@infoline @expr{-2^(w-1)} 13195@infoline @expr{-2^(w-1)}
13195to @expr{-1} will have @expr{2^w} added to them, so they will be 13196to @expr{-1} are represented by the integers from
13196represented by the integers from
13197@texline @math{2^{w-1}} 13197@texline @math{2^{w-1}}
13198@infoline @expr{2^(w-1)} 13198@infoline @expr{2^(w-1)}
13199to @expr{2^w}. Calc will represent a twos-complement integer 13199to @expr{2^w-1} (the integer @expr{k} is represented by @expr{k+2^w}).
13200by the radix (either @expr{2}, @expr{8} or @expr{16}), two @kbd{#} 13200Calc will display a two's complement integer by the radix (either
13201symbols, and then the digits (including any necessary leading zeros to 13201@expr{2}, @expr{8} or @expr{16}), two @kbd{#} symbols, and then its
13202include all @expr{w} bits). Numbers that are not displayed in 13202representation (including any leading zeros necessary to include all
13203twos-complement notation (i.e., that aren't integers from 13203@expr{w} bits). In a two's complement display mode, numbers that
13204are not displayed in two's complement notation (i.e., that aren't
13205integers from
13204@texline @math{-2^{w-1}} 13206@texline @math{-2^{w-1}}
13205@infoline @expr{-2^(w-1)} 13207@infoline @expr{-2^(w-1)}
13206to 13208to