(Radix modes): Discuss alternate bases for two's complement notations.

This commit is contained in:
Jay Belanger 2009-11-22 02:19:23 +00:00
parent 9d5005602d
commit 5ea5dbc925
2 changed files with 25 additions and 19 deletions

View file

@ -1,3 +1,8 @@
2009-11-22 Jay Belanger <jay.p.belanger@gmail.com>
* calc.texi (Radix modes): Discuss alternate bases for two's complement
notations.
2009-11-20 Carsten Dominik <dominik@u016822.science.uva.nl>
* org.texi: (Column attributes): Fix documentaion of new operators.

View file

@ -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