diff options
| author | Jay Belanger | 2009-11-22 02:19:23 +0000 |
|---|---|---|
| committer | Jay Belanger | 2009-11-22 02:19:23 +0000 |
| commit | 5ea5dbc9255d4abf0e2ab727167a2c9ba9c11076 (patch) | |
| tree | 8a719ad2115834287ad43b9ef59eae24adc65a97 | |
| parent | 9d5005602d148b84b3eabeee11e33e713d52b1cf (diff) | |
| download | emacs-5ea5dbc9255d4abf0e2ab727167a2c9ba9c11076.tar.gz emacs-5ea5dbc9255d4abf0e2ab727167a2c9ba9c11076.zip | |
(Radix modes): Discuss alternate bases for two's complement notations.
| -rw-r--r-- | doc/misc/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/misc/calc.texi | 39 |
2 files changed, 25 insertions, 19 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 7d7cb25a6f7..8d5dcc09a0b 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2009-11-22 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc.texi (Radix modes): Discuss alternate bases for two's complement | ||
| 4 | notations. | ||
| 5 | |||
| 1 | 2009-11-20 Carsten Dominik <dominik@u016822.science.uva.nl> | 6 | 2009-11-20 Carsten Dominik <dominik@u016822.science.uva.nl> |
| 2 | 7 | ||
| 3 | * org.texi: (Column attributes): Fix documentaion of new operators. | 8 | * org.texi: (Column attributes): Fix documentaion of new operators. |
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 9d1a4ac7d9c..cb29d8bcbfb 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi | |||
| @@ -13173,41 +13173,42 @@ 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 | With the command @kbd{C-u d 2}, Calc will display integers using | 13176 | |
| 13177 | twos-complement notation, using the current word-size to determine | 13177 | Calc can display @expr{w}-bit integers using two's complement notation |
| 13178 | the number of bits. When using twos-complement notation, a negative | 13178 | and binary, octal or hexadecimal display radix with the commands |
| 13179 | word size might be appropriate (@pxref{Binary Functions}). If the | 13179 | @kbd{C-u d 2}, @kbd{C-u d 8} or @kbd{C-u d 6}, respectively. In this |
| 13180 | absolute value of the word size is @expr{w}, then twos-complement | 13180 | case a negative word size might be appropriate (@pxref{Binary Functions}). |
| 13181 | notation will represent the integers in the symmetric interval from | 13181 | The integers in the symmetric interval from |
| 13182 | @texline @math{-2^{w-1}} | 13182 | @texline @math{-2^{w-1}} |
| 13183 | @infoline @expr{-2^(w-1)} | 13183 | @infoline @expr{-2^(w-1)} |
| 13184 | to | 13184 | to |
| 13185 | @texline @math{2^{w-1}-1} | 13185 | @texline @math{2^{w-1}-1} |
| 13186 | @infoline @expr{2^(w-1)-1} | 13186 | @infoline @expr{2^(w-1)-1} |
| 13187 | using the binary numbers from @expr{0} to @expr{2^w}; the | 13187 | will be represented by using the integers from @expr{0} to @expr{2^w}; |
| 13188 | integers from @expr{0} to | 13188 | the integers from @expr{0} to |
| 13189 | @texline @math{2^{w-1}-1} | 13189 | @texline @math{2^{w-1}-1} |
| 13190 | @infoline @expr{2^(w-1)-1} | 13190 | @infoline @expr{2^(w-1)-1} |
| 13191 | will be represented by their usual binary form and the integers | 13191 | will be represented by themselves and the integers |
| 13192 | from | 13192 | from |
| 13193 | @texline @math{-2^{w-1}} | 13193 | @texline @math{-2^{w-1}} |
| 13194 | @infoline @expr{-2^(w-1)} | 13194 | @infoline @expr{-2^(w-1)} |
| 13195 | to @expr{-1} will be represented by first adding @expr{2^w} to them | 13195 | to @expr{-1} will have @expr{2^w} added to them, so they will be |
| 13196 | and then using the usual binary form (so they will be represented by | 13196 | represented by the integers from |
| 13197 | the integers from | ||
| 13198 | @texline @math{2^{w-1}} | 13197 | @texline @math{2^{w-1}} |
| 13199 | @infoline @expr{2^(w-1)} | 13198 | @infoline @expr{2^(w-1)} |
| 13200 | to @expr{2^w}). Calc will represent a twos-complement integer | 13199 | to @expr{2^w}. Calc will represent a twos-complement integer |
| 13201 | by the radix @expr{2}, two @kbd{#} symbols, and the @expr{w} binary | 13200 | by the radix (either @expr{2}, @expr{8} or @expr{16}), two @kbd{#} |
| 13202 | digits (including any necessary leading zeros). Numbers that are not | 13201 | symbols, and then the digits (including any necessary leading zeros to |
| 13203 | displayed in twos-complement notation (i.e., that aren't integers from | 13202 | include all @expr{w} bits). Numbers that are not displayed in |
| 13203 | twos-complement notation (i.e., that aren't integers from | ||
| 13204 | @texline @math{-2^{w-1}} | 13204 | @texline @math{-2^{w-1}} |
| 13205 | @infoline @expr{-2^(w-1)} | 13205 | @infoline @expr{-2^(w-1)} |
| 13206 | to | 13206 | to |
| 13207 | @c ( | 13207 | @c ( |
| 13208 | @texline @math{2^{w-1}-1}) | 13208 | @texline @math{2^{w-1}-1}) |
| 13209 | @infoline @expr{2^(w-1)-1}) | 13209 | @infoline @expr{2^(w-1)-1}) |
| 13210 | will be represented using Calc's usual binary notation. | 13210 | will be represented using Calc's usual notation (in the appropriate |
| 13211 | radix). | ||
| 13211 | 13212 | ||
| 13212 | @node Grouping Digits, Float Formats, Radix Modes, Display Modes | 13213 | @node Grouping Digits, Float Formats, Radix Modes, Display Modes |
| 13213 | @subsection Grouping Digits | 13214 | @subsection Grouping Digits |