From: Paul Eggert <eggert@cs.ucla.edu>
To: Pip Cet <pipcet@gmail.com>, andrewjmoreton@gmail.com
Cc: 32463@debbugs.gnu.org
Subject: bug#32463: 27.0.50; (logior -1) => 4611686018427387903
Date: Sat, 18 Aug 2018 15:43:54 -0700 [thread overview]
Message-ID: <d3eb4df0-d66e-14da-97af-ff67bdbd1518@cs.ucla.edu> (raw)
In-Reply-To: <CAOqdjBdv+qk5v0GdtrV6X=zRE6XLfbp_OACfu7KZ6w6YR2ULVQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 257 bytes --]
Pip Cet wrote:
> I'm attaching the patch that I think should still be applied, which
> includes some tests.
Thanks. I think most of that patch was addressed by my previous patch, except
for the doc changes for 'random' for which I installed the attached.
[-- Attachment #2: 0001-Document-that-random-is-limited-to-fixnums.txt --]
[-- Type: text/plain, Size: 2557 bytes --]
From 97d273033b523bc07911c848d4e8bf96cdce0c90 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 18 Aug 2018 15:39:05 -0700
Subject: [PATCH] =?UTF-8?q?Document=20that=20=E2=80=98random=E2=80=99=20is?=
=?UTF-8?q?=20limited=20to=20fixnums?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Problem reported by Pip Cet (Bug#32463#20).
* doc/lispref/numbers.texi (Random Numbers):
* src/fns.c (Frandom): Adjust doc.
---
doc/lispref/numbers.texi | 7 +++----
src/fns.c | 9 +++------
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi
index ee6456b1be..74a313e2e1 100644
--- a/doc/lispref/numbers.texi
+++ b/doc/lispref/numbers.texi
@@ -1236,11 +1236,10 @@ Random Numbers
This function returns a pseudo-random integer. Repeated calls return a
series of pseudo-random integers.
-If @var{limit} is a positive integer, the value is chosen to be
+If @var{limit} is a positive fixnum, the value is chosen to be
nonnegative and less than @var{limit}. Otherwise, the value might be
-any integer representable in Lisp, i.e., an integer between
-@code{most-negative-fixnum} and @code{most-positive-fixnum}
-(@pxref{Integer Basics}).
+any fixnum, i.e., any integer from @code{most-negative-fixnum} through
+@code{most-positive-fixnum} (@pxref{Integer Basics}).
If @var{limit} is @code{t}, it means to choose a new seed as if Emacs
were restarting, typically from the system entropy. On systems
diff --git a/src/fns.c b/src/fns.c
index f6e6803641..a11de1b082 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -56,15 +56,12 @@ DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0,
}
DEFUN ("random", Frandom, Srandom, 0, 1, 0,
- doc: /* Return a pseudo-random number.
-All integers representable in Lisp, i.e. between `most-negative-fixnum'
-and `most-positive-fixnum', inclusive, are equally likely.
-
-With positive integer LIMIT, return random number in interval [0,LIMIT).
+ doc: /* Return a pseudo-random integer.
+By default, return a fixnum; all fixnums are equally likely.
+With positive fixnum LIMIT, return random integer in interval [0,LIMIT).
With argument t, set the random number seed from the system's entropy
pool if available, otherwise from less-random volatile data such as the time.
With a string argument, set the seed based on the string's contents.
-Other values of LIMIT are ignored.
See Info node `(elisp)Random Numbers' for more details. */)
(Lisp_Object limit)
--
2.17.1
next prev parent reply other threads:[~2018-08-18 22:43 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-17 3:29 bug#32463: 27.0.50; (logior -1) => 4611686018427387903 Katsumi Yamaoka
2018-08-17 5:59 ` Pip Cet
2018-08-17 7:40 ` Katsumi Yamaoka
2018-08-17 9:27 ` Andy Moreton
2018-08-17 11:36 ` Pip Cet
2018-08-17 11:53 ` Pip Cet
2018-08-17 13:27 ` Andy Moreton
2018-08-18 22:43 ` Paul Eggert [this message]
2018-08-17 13:24 ` Andy Moreton
2018-08-18 18:48 ` Paul Eggert
2018-08-18 18:59 ` Eli Zaretskii
2018-08-18 19:58 ` Pip Cet
2018-08-18 22:27 ` Paul Eggert
2018-08-19 15:03 ` Eli Zaretskii
2018-08-18 19:59 ` Paul Eggert
2018-08-18 19:45 ` Andy Moreton
2018-08-19 10:43 ` Live System User
2018-08-20 3:02 ` Richard Stallman
2018-08-20 3:47 ` Paul Eggert
2018-08-21 3:37 ` Richard Stallman
2018-08-18 22:56 ` Paul Eggert
2018-08-18 23:17 ` Paul Eggert
2018-08-19 10:34 ` Andy Moreton
2018-08-19 10:48 ` Pip Cet
2018-08-19 10:59 ` Paul Eggert
2018-08-19 11:32 ` Pip Cet
2018-08-21 9:40 ` Paul Eggert
2018-08-21 10:50 ` Andy Moreton
2018-08-21 14:36 ` Eli Zaretskii
2018-08-21 14:52 ` Andy Moreton
2018-08-21 17:24 ` Paul Eggert
2018-08-19 10:52 ` Paul Eggert
2018-08-22 2:29 ` Paul Eggert
2018-08-22 16:56 ` Tom Tromey
2018-08-22 17:52 ` Paul Eggert
2018-08-22 18:25 ` Eli Zaretskii
2018-08-23 0:28 ` Paul Eggert
2018-08-23 2:39 ` Eli Zaretskii
2018-08-19 18:00 ` Andy Moreton
2018-08-22 2:34 ` Paul Eggert
2018-08-22 23:27 ` Andy Moreton
2018-08-23 14:05 ` Eli Zaretskii
2018-08-22 2:56 ` Paul Eggert
2018-08-22 8:20 ` Andy Moreton
2018-08-22 8:39 ` Andy Moreton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d3eb4df0-d66e-14da-97af-ff67bdbd1518@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=32463@debbugs.gnu.org \
--cc=andrewjmoreton@gmail.com \
--cc=pipcet@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.