emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/doc/misc calc.texi


From: Jay Belanger
Subject: [Emacs-diffs] emacs/doc/misc calc.texi
Date: Mon, 16 Nov 2009 23:41:20 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Jay Belanger <jpb>      09/11/16 23:41:20

Modified files:
        doc/misc       : calc.texi 

Log message:
        (Radix modes):  Mention twos-complement notation.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/doc/misc/calc.texi?cvsroot=emacs&r1=1.42&r2=1.43

Patches:
Index: calc.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/doc/misc/calc.texi,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- calc.texi   30 Aug 2009 02:42:06 -0000      1.42
+++ calc.texi   16 Nov 2009 23:41:19 -0000      1.43
@@ -13173,6 +13173,42 @@
 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
address@hidden @math{-2^{w-1}}
address@hidden @expr{-2^(w-1)}
+to
address@hidden @math{2^{w-1}-1}
address@hidden @expr{2^(w-1)-1}
+using the binary numbers from @expr{0} to @expr{2^w}; the
+integers from @expr{0} to 
address@hidden @math{2^{w-1}-1}
address@hidden @expr{2^(w-1)-1}
+will be represented by their usual binary form and the integers
+from 
address@hidden @math{-2^{w-1}}
address@hidden @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
address@hidden @math{2^{w-1}}
address@hidden @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 
address@hidden @math{-2^{w-1}}
address@hidden @expr{-2^(w-1)}
+to 
address@hidden (
address@hidden @math{2^{w-1}-1})
address@hidden @expr{2^(w-1)-1})
+will be represented using Calc's usual binary notation.
+
 @node Grouping Digits, Float Formats, Radix Modes, Display Modes
 @subsection Grouping Digits
 
@@ -17969,7 +18005,7 @@
 particular, negative arguments are converted to positive integers modulo
 @expr{2^w} by all binary functions.
 
-If the word size is negative, binary operations produce 2's complement
+If the word size is negative, binary operations produce twos-complement
 integers from 
 @texline @math{-2^{-w-1}}
 @infoline @expr{-(2^(-w-1))} 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]