diff options
| author | Jay Belanger | 2009-12-15 00:58:26 +0000 |
|---|---|---|
| committer | Jay Belanger | 2009-12-15 00:58:26 +0000 |
| commit | 0e9833273dc900ac826c8b8be9f09997bde43117 (patch) | |
| tree | 1a6c055d343876d01501b364536e082f74f25574 | |
| parent | fd47199325ddfe6fe99bffe7e410bf5d32865e7c (diff) | |
| download | emacs-0e9833273dc900ac826c8b8be9f09997bde43117.tar.gz emacs-0e9833273dc900ac826c8b8be9f09997bde43117.zip | |
(Radix Modes): Clarify two's complement notation.
| -rw-r--r-- | doc/misc/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/misc/calc.texi | 34 |
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 @@ | |||
| 1 | 2009-12-15 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc/calc.texi (Radix Modes): Clarify two's complement notation. | ||
| 4 | |||
| 1 | 2009-12-14 Chong Yidong <cyd@stupidchicken.com> | 5 | 2009-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 | |||
| 13173 | in the current radix. (Larger integers will still be displayed in their | 13173 | in the current radix. (Larger integers will still be displayed in their |
| 13174 | entirety.) | 13174 | entirety.) |
| 13175 | 13175 | ||
| 13176 | 13176 | @cindex Two's complements | |
| 13177 | Calc can display @expr{w}-bit integers using two's complement notation | 13177 | With the binary, octal and hexadecimal display modes, Calc can |
| 13178 | and binary, octal or hexadecimal display radix with the commands | 13178 | display @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 | 13179 | versions of the display radices are selected with the key sequences |
| 13180 | case 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. |
| 13181 | The integers in the symmetric interval from | 13181 | In these cases a negative word size might be appropriate |
| 13182 | (@pxref{Binary Functions}). In two's complement notation, the integers | ||
| 13183 | in 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)} |
| 13184 | to | 13186 | to |
| 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} |
| 13187 | will be represented by using the integers from @expr{0} to @expr{2^w}; | 13189 | are represented by the integers from @expr{0} to @expr{2^w-1}: |
| 13188 | the integers from @expr{0} to | 13190 | the 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} |
| 13191 | will be represented by themselves and the integers | 13193 | are represented by themselves and the integers from |
| 13192 | from | ||
| 13193 | @texline @math{-2^{w-1}} | 13194 | @texline @math{-2^{w-1}} |
| 13194 | @infoline @expr{-2^(w-1)} | 13195 | @infoline @expr{-2^(w-1)} |
| 13195 | to @expr{-1} will have @expr{2^w} added to them, so they will be | 13196 | to @expr{-1} are represented by the integers from |
| 13196 | represented 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)} |
| 13199 | to @expr{2^w}. Calc will represent a twos-complement integer | 13199 | to @expr{2^w-1} (the integer @expr{k} is represented by @expr{k+2^w}). |
| 13200 | by the radix (either @expr{2}, @expr{8} or @expr{16}), two @kbd{#} | 13200 | Calc will display a two's complement integer by the radix (either |
| 13201 | symbols, and then the digits (including any necessary leading zeros to | 13201 | @expr{2}, @expr{8} or @expr{16}), two @kbd{#} symbols, and then its |
| 13202 | include all @expr{w} bits). Numbers that are not displayed in | 13202 | representation (including any leading zeros necessary to include all |
| 13203 | twos-complement notation (i.e., that aren't integers from | 13203 | @expr{w} bits). In a two's complement display mode, numbers that |
| 13204 | are not displayed in two's complement notation (i.e., that aren't | ||
| 13205 | integers 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)} |
| 13206 | to | 13208 | to |