aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2009-11-22 02:19:23 +0000
committerJay Belanger2009-11-22 02:19:23 +0000
commit5ea5dbc9255d4abf0e2ab727167a2c9ba9c11076 (patch)
tree8a719ad2115834287ad43b9ef59eae24adc65a97
parent9d5005602d148b84b3eabeee11e33e713d52b1cf (diff)
downloademacs-5ea5dbc9255d4abf0e2ab727167a2c9ba9c11076.tar.gz
emacs-5ea5dbc9255d4abf0e2ab727167a2c9ba9c11076.zip
(Radix modes): Discuss alternate bases for two's complement notations.
-rw-r--r--doc/misc/ChangeLog5
-rw-r--r--doc/misc/calc.texi39
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 @@
12009-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
12009-11-20 Carsten Dominik <dominik@u016822.science.uva.nl> 62009-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
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 13176
13177twos-complement notation, using the current word-size to determine 13177Calc can display @expr{w}-bit integers using two's complement notation
13178the number of bits. When using twos-complement notation, a negative 13178and binary, octal or hexadecimal display radix with the commands
13179word 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
13180absolute value of the word size is @expr{w}, then twos-complement 13180case a negative word size might be appropriate (@pxref{Binary Functions}).
13181notation will represent the integers in the symmetric interval from 13181The 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)}
13184to 13184to
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}
13187using the binary numbers from @expr{0} to @expr{2^w}; the 13187will be represented by using the integers from @expr{0} to @expr{2^w};
13188integers from @expr{0} to 13188the 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}
13191will be represented by their usual binary form and the integers 13191will be represented by themselves and the integers
13192from 13192from
13193@texline @math{-2^{w-1}} 13193@texline @math{-2^{w-1}}
13194@infoline @expr{-2^(w-1)} 13194@infoline @expr{-2^(w-1)}
13195to @expr{-1} will be represented by first adding @expr{2^w} to them 13195to @expr{-1} will have @expr{2^w} added to them, so they will be
13196and then using the usual binary form (so they will be represented by 13196represented by the integers from
13197the 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)}
13200to @expr{2^w}). Calc will represent a twos-complement integer 13199to @expr{2^w}. Calc will represent a twos-complement integer
13201by the radix @expr{2}, two @kbd{#} symbols, and the @expr{w} binary 13200by the radix (either @expr{2}, @expr{8} or @expr{16}), two @kbd{#}
13202digits (including any necessary leading zeros). Numbers that are not 13201symbols, and then the digits (including any necessary leading zeros to
13203displayed in twos-complement notation (i.e., that aren't integers from 13202include all @expr{w} bits). Numbers that are not displayed in
13203twos-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)}
13206to 13206to
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})
13210will be represented using Calc's usual binary notation. 13210will be represented using Calc's usual notation (in the appropriate
13211radix).
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