]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/numbers.texi
Merge from origin/emacs-25
[gnu-emacs] / doc / lispref / numbers.texi
index 7b4a0a6d407cf80ee64e5873a0f4950ce1784ffd..20d3c4290f35024836269b1b1cf8e0103996c631 100644 (file)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990-1995, 1998-1999, 2001-2015 Free Software
+@c Copyright (C) 1990-1995, 1998-1999, 2001-2016 Free Software
 @c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Numbers
@@ -224,7 +224,7 @@ distinguish them.
 @cindex NaN
   The @acronym{IEEE} floating-point standard supports positive
 infinity and negative infinity as floating-point values.  It also
-provides for a class of values called NaN or ``not-a-number'';
+provides for a class of values called NaN, or ``not a number'';
 numerical functions return such values in cases where there is no
 correct answer.  For example, @code{(/ 0.0 0.0)} returns a NaN@.
 Although NaN values carry a sign, for practical purposes there is no other
@@ -642,10 +642,11 @@ product.  When given no arguments, @code{*} returns 1.
 @end example
 @end defun
 
-@defun / dividend divisor &rest divisors
-This function divides @var{dividend} by @var{divisor} and returns the
-quotient.  If there are additional arguments @var{divisors}, then it
-divides @var{dividend} by each divisor in turn.  Each argument may be a
+@defun / number &rest divisors
+With one or more @var{divisors}, this function divides @var{number}
+by each divisor in @var{divisors} in turn, and returns the quotient.
+With no @var{divisors}, this function returns 1/@var{number}, i.e.,
+the multiplicative inverse of @var{number}.  Each argument may be a
 number or a marker.
 
 If all the arguments are integers, the result is an integer, obtained
@@ -673,6 +674,14 @@ by rounding the quotient towards zero after each division.
      @result{} 2.5
 @end group
 @group
+(/ 4.0)
+     @result{} 0.25
+@end group
+@group
+(/ 4)
+     @result{} 0
+@end group
+@group
 (/ 25 3 2)
      @result{} 4
 @end group
@@ -812,7 +821,7 @@ Rounding a value equidistant between two integers returns the even integer.
 sequence of @dfn{bits} (digits which are either zero or one).  A bitwise
 operation acts on the individual bits of such a sequence.  For example,
 @dfn{shifting} moves the whole sequence left or right one or more places,
-reproducing the same pattern ``moved over''.
+reproducing the same pattern moved over.
 
   The bitwise operations in Emacs Lisp apply only to integers.
 
@@ -989,17 +998,16 @@ Here are other examples:
 @end defun
 
 @defun logand &rest ints-or-markers
-This function returns the ``logical and'' of the arguments: the
-@var{n}th bit is set in the result if, and only if, the @var{n}th bit is
-set in all the arguments.  (``Set'' means that the value of the bit is 1
-rather than 0.)
+This function returns the bitwise AND of the arguments: the @var{n}th
+bit is 1 in the result if, and only if, the @var{n}th bit is 1 in all
+the arguments.
 
-For example, using 4-bit binary numbers, the ``logical and'' of 13 and
+For example, using 4-bit binary numbers, the bitwise AND of 13 and
 12 is 12: 1101 combined with 1100 produces 1100.
-In both the binary numbers, the leftmost two bits are set (i.e., they
-are 1's), so the leftmost two bits of the returned value are set.
-However, for the rightmost two bits, each is zero in at least one of
-the arguments, so the rightmost two bits of the returned value are 0's.
+In both the binary numbers, the leftmost two bits are both 1
+so the leftmost two bits of the returned value are both 1.
+However, for the rightmost two bits, each is 0 in at least one of
+the arguments, so the rightmost two bits of the returned value are both 0.
 
 @noindent
 Therefore,
@@ -1040,9 +1048,9 @@ because its binary representation consists entirely of ones.  If
 @end defun
 
 @defun logior &rest ints-or-markers
-This function returns the ``inclusive or'' of its arguments: the @var{n}th bit
-is set in the result if, and only if, the @var{n}th bit is set in at least
-one of the arguments.  If there are no arguments, the result is zero,
+This function returns the bitwise inclusive OR of its arguments: the @var{n}th
+bit is 1 in the result if, and only if, the @var{n}th bit is 1 in at
+least one of the arguments.  If there are no arguments, the result is 0,
 which is an identity element for this operation.  If @code{logior} is
 passed just one argument, it returns that argument.
 
@@ -1065,9 +1073,9 @@ passed just one argument, it returns that argument.
 @end defun
 
 @defun logxor &rest ints-or-markers
-This function returns the ``exclusive or'' of its arguments: the
-@var{n}th bit is set in the result if, and only if, the @var{n}th bit is
-set in an odd number of the arguments.  If there are no arguments, the
+This function returns the bitwise exclusive OR of its arguments: the
+@var{n}th bit is 1 in the result if, and only if, the @var{n}th bit is
+1 in an odd number of the arguments.  If there are no arguments, the
 result is 0, which is an identity element for this operation.  If
 @code{logxor} is passed just one argument, it returns that argument.
 
@@ -1090,7 +1098,7 @@ result is 0, which is an identity element for this operation.  If
 @end defun
 
 @defun lognot integer
-This function returns the logical complement of its argument: the @var{n}th
+This function returns the bitwise complement of its argument: the @var{n}th
 bit is one in the result if, and only if, the @var{n}th bit is zero in
 @var{integer}, and vice-versa.
 
@@ -1218,7 +1226,8 @@ fashion.  The numbers are not truly random, but they have certain
 properties that mimic a random series.  For example, all possible
 values occur equally often in a pseudo-random series.
 
-  Pseudo-random numbers are generated from a ``seed''.  Starting from
+@cindex seed, for random number generation
+  Pseudo-random numbers are generated from a @dfn{seed value}.  Starting from
 any given seed, the @code{random} function always generates the same
 sequence of numbers.  By default, Emacs initializes the random seed at
 startup, in such a way that the sequence of values of @code{random}