diff options
| author | Jay Belanger | 2009-11-16 23:41:36 +0000 |
|---|---|---|
| committer | Jay Belanger | 2009-11-16 23:41:36 +0000 |
| commit | 17291a1fc4baefa956b9ca746f9492c99a21f4f1 (patch) | |
| tree | 597b307b0b156583b7c713d47bd0db6d41eb6441 /doc/misc | |
| parent | 14467b99c9bcf328d59789ec7dc2147ac20b87e0 (diff) | |
| download | emacs-17291a1fc4baefa956b9ca746f9492c99a21f4f1.tar.gz emacs-17291a1fc4baefa956b9ca746f9492c99a21f4f1.zip | |
(Radix modes): Mention twos-complement notation.
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/misc/calc.texi | 38 |
2 files changed, 41 insertions, 1 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 51babe24343..d5b3e2947af 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2009-11-16 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc.texi (Radix modes): Mention twos-complement notation. | ||
| 4 | |||
| 1 | 2009-11-16 Juanma Barranquero <lekktu@gmail.com> | 5 | 2009-11-16 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 6 | ||
| 3 | * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add semantic. | 7 | * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add semantic. |
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 672288e9173..9d1a4ac7d9c 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi | |||
| @@ -13173,6 +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 | ||
| 13177 | twos-complement notation, using the current word-size to determine | ||
| 13178 | the number of bits. When using twos-complement notation, a negative | ||
| 13179 | word size might be appropriate (@pxref{Binary Functions}). If the | ||
| 13180 | absolute value of the word size is @expr{w}, then twos-complement | ||
| 13181 | notation will represent the integers in the symmetric interval from | ||
| 13182 | @texline @math{-2^{w-1}} | ||
| 13183 | @infoline @expr{-2^(w-1)} | ||
| 13184 | to | ||
| 13185 | @texline @math{2^{w-1}-1} | ||
| 13186 | @infoline @expr{2^(w-1)-1} | ||
| 13187 | using the binary numbers from @expr{0} to @expr{2^w}; the | ||
| 13188 | integers from @expr{0} to | ||
| 13189 | @texline @math{2^{w-1}-1} | ||
| 13190 | @infoline @expr{2^(w-1)-1} | ||
| 13191 | will be represented by their usual binary form and the integers | ||
| 13192 | from | ||
| 13193 | @texline @math{-2^{w-1}} | ||
| 13194 | @infoline @expr{-2^(w-1)} | ||
| 13195 | to @expr{-1} will be represented by first adding @expr{2^w} to them | ||
| 13196 | and then using the usual binary form (so they will be represented by | ||
| 13197 | the integers from | ||
| 13198 | @texline @math{2^{w-1}} | ||
| 13199 | @infoline @expr{2^(w-1)} | ||
| 13200 | 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 | ||
| 13202 | digits (including any necessary leading zeros). Numbers that are not | ||
| 13203 | displayed in twos-complement notation (i.e., that aren't integers from | ||
| 13204 | @texline @math{-2^{w-1}} | ||
| 13205 | @infoline @expr{-2^(w-1)} | ||
| 13206 | to | ||
| 13207 | @c ( | ||
| 13208 | @texline @math{2^{w-1}-1}) | ||
| 13209 | @infoline @expr{2^(w-1)-1}) | ||
| 13210 | will be represented using Calc's usual binary notation. | ||
| 13211 | |||
| 13176 | @node Grouping Digits, Float Formats, Radix Modes, Display Modes | 13212 | @node Grouping Digits, Float Formats, Radix Modes, Display Modes |
| 13177 | @subsection Grouping Digits | 13213 | @subsection Grouping Digits |
| 13178 | 13214 | ||
| @@ -17969,7 +18005,7 @@ of the binary operations described here operate modulo @expr{2^w}. In | |||
| 17969 | particular, negative arguments are converted to positive integers modulo | 18005 | particular, negative arguments are converted to positive integers modulo |
| 17970 | @expr{2^w} by all binary functions. | 18006 | @expr{2^w} by all binary functions. |
| 17971 | 18007 | ||
| 17972 | If the word size is negative, binary operations produce 2's complement | 18008 | If the word size is negative, binary operations produce twos-complement |
| 17973 | integers from | 18009 | integers from |
| 17974 | @texline @math{-2^{-w-1}} | 18010 | @texline @math{-2^{-w-1}} |
| 17975 | @infoline @expr{-(2^(-w-1))} | 18011 | @infoline @expr{-(2^(-w-1))} |