Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
0e983327
Commit
0e983327
authored
Dec 15, 2009
by
Jay Belanger
Browse files
(Radix Modes): Clarify two's complement notation.
parent
fd471993
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
16 deletions
+22
-16
doc/misc/ChangeLog
doc/misc/ChangeLog
+4
-0
doc/misc/calc.texi
doc/misc/calc.texi
+18
-16
No files found.
doc/misc/ChangeLog
View file @
0e983327
2009-12-15 Jay Belanger <jay.p.belanger@gmail.com>
* calc/calc.texi (Radix Modes): Clarify two's complement notation.
2009-12-14 Chong Yidong <cyd@stupidchicken.com>
* sem-user.texi (Semantic mode, Idle Scheduler, Smart Completion)
...
...
doc/misc/calc.texi
View file @
0e983327
...
...
@@ -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 b
e represented by
using
the integers from @expr{0} to @expr{2^w
};
ar
e 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment