aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorJay Belanger2009-11-16 23:41:36 +0000
committerJay Belanger2009-11-16 23:41:36 +0000
commit17291a1fc4baefa956b9ca746f9492c99a21f4f1 (patch)
tree597b307b0b156583b7c713d47bd0db6d41eb6441 /doc/misc
parent14467b99c9bcf328d59789ec7dc2147ac20b87e0 (diff)
downloademacs-17291a1fc4baefa956b9ca746f9492c99a21f4f1.tar.gz
emacs-17291a1fc4baefa956b9ca746f9492c99a21f4f1.zip
(Radix modes): Mention twos-complement notation.
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/ChangeLog4
-rw-r--r--doc/misc/calc.texi38
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 @@
12009-11-16 Jay Belanger <jay.p.belanger@gmail.com>
2
3 * calc.texi (Radix modes): Mention twos-complement notation.
4
12009-11-16 Juanma Barranquero <lekktu@gmail.com> 52009-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
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
13176With the command @kbd{C-u d 2}, Calc will display integers using
13177twos-complement notation, using the current word-size to determine
13178the number of bits. When using twos-complement notation, a negative
13179word size might be appropriate (@pxref{Binary Functions}). If the
13180absolute value of the word size is @expr{w}, then twos-complement
13181notation will represent the integers in the symmetric interval from
13182@texline @math{-2^{w-1}}
13183@infoline @expr{-2^(w-1)}
13184to
13185@texline @math{2^{w-1}-1}
13186@infoline @expr{2^(w-1)-1}
13187using the binary numbers from @expr{0} to @expr{2^w}; the
13188integers from @expr{0} to
13189@texline @math{2^{w-1}-1}
13190@infoline @expr{2^(w-1)-1}
13191will be represented by their usual binary form and the integers
13192from
13193@texline @math{-2^{w-1}}
13194@infoline @expr{-2^(w-1)}
13195to @expr{-1} will be represented by first adding @expr{2^w} to them
13196and then using the usual binary form (so they will be represented by
13197the integers from
13198@texline @math{2^{w-1}}
13199@infoline @expr{2^(w-1)}
13200to @expr{2^w}). Calc will represent a twos-complement integer
13201by the radix @expr{2}, two @kbd{#} symbols, and the @expr{w} binary
13202digits (including any necessary leading zeros). Numbers that are not
13203displayed in twos-complement notation (i.e., that aren't integers from
13204@texline @math{-2^{w-1}}
13205@infoline @expr{-2^(w-1)}
13206to
13207@c (
13208@texline @math{2^{w-1}-1})
13209@infoline @expr{2^(w-1)-1})
13210will 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
17969particular, negative arguments are converted to positive integers modulo 18005particular, 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
17972If the word size is negative, binary operations produce 2's complement 18008If the word size is negative, binary operations produce twos-complement
17973integers from 18009integers 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))}