From 5ea5dbc9255d4abf0e2ab727167a2c9ba9c11076 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sun, 22 Nov 2009 02:19:23 +0000 Subject: [PATCH] (Radix modes): Discuss alternate bases for two's complement notations. --- doc/misc/ChangeLog | 5 +++++ 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 @@ +2009-11-22 Jay Belanger + + * calc.texi (Radix modes): Discuss alternate bases for two's complement + notations. + 2009-11-20 Carsten Dominik * 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 in the current radix. (Larger integers will still be displayed in their entirety.) -With the command @kbd{C-u d 2}, Calc will display integers using -twos-complement notation, using the current word-size to determine -the number of bits. When using twos-complement notation, a negative -word size might be appropriate (@pxref{Binary Functions}). If the -absolute value of the word size is @expr{w}, then twos-complement -notation will represent the integers in the symmetric interval from + +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 @texline @math{-2^{w-1}} @infoline @expr{-2^(w-1)} to @texline @math{2^{w-1}-1} @infoline @expr{2^(w-1)-1} -using the binary numbers from @expr{0} to @expr{2^w}; the -integers from @expr{0} to +will be represented by using the integers from @expr{0} to @expr{2^w}; +the integers from @expr{0} to @texline @math{2^{w-1}-1} @infoline @expr{2^(w-1)-1} -will be represented by their usual binary form and the integers -from +will be represented by themselves and the integers +from @texline @math{-2^{w-1}} @infoline @expr{-2^(w-1)} -to @expr{-1} will be represented by first adding @expr{2^w} to them -and then using the usual binary form (so they will be represented by -the integers from +to @expr{-1} will have @expr{2^w} added to them, so they will be +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 @expr{2}, two @kbd{#} symbols, and the @expr{w} binary -digits (including any necessary leading zeros). Numbers that are not -displayed in twos-complement notation (i.e., that aren't integers from +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 @texline @math{-2^{w-1}} @infoline @expr{-2^(w-1)} -to +to @c ( @texline @math{2^{w-1}-1}) @infoline @expr{2^(w-1)-1}) -will be represented using Calc's usual binary notation. +will be represented using Calc's usual notation (in the appropriate +radix). @node Grouping Digits, Float Formats, Radix Modes, Display Modes @subsection Grouping Digits -- 2.11.4.GIT