GNU bug report logs - #32605
[w64] (random) never returns negative

Previous Next

Package: emacs;

Reported by: f.j.wright <at> live.co.uk

Date: Sat, 1 Sep 2018 17:21:01 UTC

Severity: normal

Tags: confirmed

Found in version 26.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 32605 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Francis Wright <francis.j.wright <at> gmail.com>
Cc: f.j.wright <at> live.co.uk, 32605 <at> debbugs.gnu.org
Subject: Re: bug#32605: 26.1; (random) never returns negative
Date: Sat, 01 Sep 2018 19:34:35 +0200
On Sat, 01 Sep 2018 18:18:01 +0100 Francis Wright <francis.j.wright <at> gmail.com> wrote:

> According to my reading of both the documentation for the function
> random and its description in the manual, if it is called with no
> argument then "the value might be any integer representable in Lisp,
> i.e., an integer between ‘most-negative-fixnum’ and
> ‘most-positive-fixnum’".  Therefore, it should return a negative integer
> half the time, but I have never yet seen it return a negative value.  So
> either the documentation or the implementation is wrong.  For what it's
> worth, I would prefer the documented behaviour over the current actual
> behaviour.
>
>
> In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
>  of 2018-05-30 built on CIRROCUMULUS
> Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
> Windowing system distributor 'Microsoft Corp.', version 10.0.17134

Prompted by this report, I just ran `M-: (random)' twice, with these
results:

1407814790132564328 (#o116114401367331100550, #x13899017bb648168)
-5902216973509885 (#o-247600437205762375, #x-14f808fa17e4fd)

This was on a build from current master under GNU/Linux

Steve Berman




This bug report was last modified 4 years ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.