Debian Bug report logs - #803459
drand48(3): errors on interval bounds

version graph

Package: manpages-dev; Maintainer for manpages-dev is Dr. Tobias Quathamer <[email protected]>; Source for manpages-dev is src:manpages (PTS, buildd, popcon).

Reported by: Vincent Lefevre <[email protected]>

Date: Fri, 30 Oct 2015 10:21:02 UTC

Severity: normal

Tags: fixed-upstream

Found in version manpages/3.74-1

Fixed in version 4.04-1

Done: "Dr. Tobias Quathamer" <[email protected]>

Bug is archived. No further changes may be made.

Full log


Message #12 received at [email protected] (full text, mbox, reply):

Received: (at control) by bugs.debian.org; 17 Dec 2015 14:12:44 +0000
From [email protected] Thu Dec 17 14:12:44 2015
X-Spam-Checker-Version: SpamAssassin 3.4.0-bugs.debian.org_2005_01_02
	(2014-02-07) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-7.8 required=4.0 tests=BAYES_00,DIGITS_LETTERS,
	DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FOURLA,FREEMAIL_FROM,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_LOW,SPF_PASS,VALID_BTS_CONTROL autolearn=ham
	autolearn_force=no version=3.4.0-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 9; hammy, 150; neutral, 80; spammy, 0.
	spammytokens: hammytokens:0.000-+--UD:kernel.org, 0.000-+--wwwkernelorg,
	0.000-+--www.kernel.org, 0.000-+--UD:www.kernel.org, 0.000-+--HTo:D*vinc17.net
Return-path: <[email protected]>
Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232])
	by buxtehude.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.84)
	(envelope-from <[email protected]>)
	id 1a9ZIS-0004O4-2W; Thu, 17 Dec 2015 14:12:44 +0000
Received: by mail-wm0-x232.google.com with SMTP id l126so25287487wml.1;
        Thu, 17 Dec 2015 06:12:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=subject:to:references:cc:from:message-id:date:user-agent
         :mime-version:in-reply-to:content-type:content-transfer-encoding;
        bh=Zfb25hWP4cBXpE7t4gFCXjkU6IQm/Dqzgwqyy0jeL/M=;
        b=Z+ndZBtIyP+PZIUvQo7nJMvHxK9Fwlkg4Rlo6oTG6WN544UxSVual3e9+3TcGN7Ngm
         qnpAm+2q4Hcmz9BJg9SHuU7Eg+SZyPjzFw4uJiEgcf46XyQMJt2z16/qvaP9xX+pXbVp
         BPM+SmgcRXutFBeVGMfBVuPqVLwtFqSGc4hIgmQ3rYSEUH0lgdp5CzeNe+rICCZz7y6t
         mfW+1F8EBO4dFGsBuuh4JqfxSU3iviKAej7EKj2cLiJPbeyxwbGPeVYHXOrKBAkmCQdO
         Dxuk6ABQvLgFOto7hgiWStgU5kiGAVSILpTq7vKm0INzGlAS2Jfwscu8BEU8Pe07KDm/
         iYDQ==
X-Received: by 10.28.68.213 with SMTP id r204mr4191472wma.35.1450361557106;
        Thu, 17 Dec 2015 06:12:37 -0800 (PST)
Received: from [192.168.235.37] (mail.jambit.com. [95.157.63.22])
        by smtp.gmail.com with ESMTPSA id xs9sm10631234wjc.43.2015.12.17.06.12.34
        (version=TLSv1/SSLv3 cipher=OTHER);
        Thu, 17 Dec 2015 06:12:35 -0800 (PST)
Subject: Re: Bug#803459: drand48(3): errors on interval bounds
To: Vincent Lefevre <[email protected]>, [email protected]
References: <[email protected]>
Cc: [email protected], [email protected]
From: "Michael Kerrisk (man-pages)" <[email protected]>
Message-ID: <[email protected]>
Date: Thu, 17 Dec 2015 15:12:32 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.4.0
MIME-Version: 1.0
In-Reply-To: <[email protected]>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Delivered-To: [email protected]
tags 803459 fixed-upstream
thanks

Hello Vincent
On 10/30/2015 11:17 AM, Vincent Lefevre wrote:
> Package: manpages-dev
> Version: 3.74-1
> Severity: normal
> 
> The drand48(3) man page contains:
> 
>        The  drand48()  and  erand48()  functions return nonnegative
>        double-precision floating-point values uniformly distributed
>        between [0.0, 1.0).
> 
> Instead of "between", it should be "over".
> 
> Then, more importantly, there are errors for lrand48, nrand48,
> lrand48, and jrand48:
> 
>        The  lrand48()  and  nrand48()  functions return nonnegative
>        long integers uniformly distributed between 0 and 2^31.
> 
>        The mrand48() and jrand48()  functions  return  signed  long
>        integers uniformly distributed between -2^31 and 2^31.
> 
> According to POSIX, the right bound is 2^31 - 1. Or if you want to
> keep 2^31, you should give a semi-open interval as in POSIX: [0,2^31)
> and [-2^31,2^31) respectively.

Upstream, I have applied the patch below. Thanks for the report.

Cheers,

Michael

diff --git a/man3/drand48.3 b/man3/drand48.3
index 1d4799f..0de9cf2 100644
--- a/man3/drand48.3
+++ b/man3/drand48.3
@@ -81,22 +81,22 @@ The
 and
 .BR erand48 ()
 functions return nonnegative
-double-precision floating-point values uniformly distributed between
-[0.0, 1.0).
+double-precision floating-point values uniformly distributed over the interval
+[0.0,\ 1.0).
 .PP
 The
 .BR lrand48 ()
 and
 .BR nrand48 ()
 functions return nonnegative
-long integers uniformly distributed between 0 and 2^31.
+long integers uniformly distributed over the interval [0,\ 2^31).
 .PP
 The
 .BR mrand48 ()
 and
 .BR jrand48 ()
 functions return signed long
-integers uniformly distributed between \-2^31 and 2^31.
+integers uniformly distributed over the interval [\-2^31,\ 2^31).
 .PP
 The
 .BR srand48 (),

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Mon Nov 11 10:12:47 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.