From 0e9833273dc900ac826c8b8be9f09997bde43117 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Tue, 15 Dec 2009 00:58:26 +0000 Subject: [PATCH] (Radix Modes): Clarify two's complement notation. --- doc/misc/ChangeLog | 4 ++++ 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 @@ +2009-12-15 Jay Belanger + + * calc/calc.texi (Radix Modes): Clarify two's complement notation. + 2009-12-14 Chong Yidong * 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 in the current radix. (Larger integers will still be displayed in their entirety.) - -Calc can display @expr{w}-bit integers using two's complement notation -and binary, octal or hexadecimal display radix with the commands -@kbd{C-u d 2}, @kbd{C-u d 8} or @kbd{C-u d 6}, respectively. In this -case a negative word size might be appropriate (@pxref{Binary Functions}). -The integers in the symmetric interval from +@cindex Two's complements +With the binary, octal and hexadecimal display modes, Calc can +display @expr{w}-bit integers using two's complement notation. These +versions of the display radices are selected with the key sequences +@kbd{C-u d 2}, @kbd{C-u d 8} and @kbd{C-u d 6}, respectively. +In these cases a negative word size might be appropriate +(@pxref{Binary Functions}). In two's complement notation, the integers +in the (nearly) symmetric interval from @texline @math{-2^{w-1}} @infoline @expr{-2^(w-1)} to @texline @math{2^{w-1}-1} @infoline @expr{2^(w-1)-1} -will be represented by using the integers from @expr{0} to @expr{2^w}; +are represented by the integers from @expr{0} to @expr{2^w-1}: the integers from @expr{0} to @texline @math{2^{w-1}-1} @infoline @expr{2^(w-1)-1} -will be represented by themselves and the integers -from +are represented by themselves and the integers from @texline @math{-2^{w-1}} @infoline @expr{-2^(w-1)} -to @expr{-1} will have @expr{2^w} added to them, so they will be -represented by the integers from +to @expr{-1} are represented by the integers from @texline @math{2^{w-1}} @infoline @expr{2^(w-1)} -to @expr{2^w}. Calc will represent a twos-complement integer -by the radix (either @expr{2}, @expr{8} or @expr{16}), two @kbd{#} -symbols, and then the digits (including any necessary leading zeros to -include all @expr{w} bits). Numbers that are not displayed in -twos-complement notation (i.e., that aren't integers from +to @expr{2^w-1} (the integer @expr{k} is represented by @expr{k+2^w}). +Calc will display a two's complement integer by the radix (either +@expr{2}, @expr{8} or @expr{16}), two @kbd{#} symbols, and then its +representation (including any leading zeros necessary to include all +@expr{w} bits). In a two's complement display mode, numbers that +are not displayed in two's complement notation (i.e., that aren't +integers from @texline @math{-2^{w-1}} @infoline @expr{-2^(w-1)} to -- 2.11.4.GIT