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.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Martin Schulze <[email protected]>:
Bug#803459; Package manpages-dev. (Fri, 30 Oct 2015 10:21:05 GMT) (full text, mbox, link).


Acknowledgement sent to Vincent Lefevre <[email protected]>:
New Bug report received and forwarded. Copy sent to Martin Schulze <[email protected]>. (Fri, 30 Oct 2015 10:21:05 GMT) (full text, mbox, link).


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

From: Vincent Lefevre <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: drand48(3): errors on interval bounds
Date: Fri, 30 Oct 2015 11:17:14 +0100
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.

-- System Information:
Debian Release: stretch/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.2.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages manpages-dev depends on:
ii  manpages  3.74-1

manpages-dev recommends no packages.

Versions of packages manpages-dev suggests:
ii  man-db [man-browser]  2.7.4-1

-- no debconf information



Information forwarded to [email protected], Martin Schulze <[email protected]>:
Bug#803459; Package manpages-dev. (Thu, 17 Dec 2015 14:15:03 GMT) (full text, mbox, link).


Acknowledgement sent to "Michael Kerrisk (man-pages)" <[email protected]>:
Extra info received and forwarded to list. Copy sent to Martin Schulze <[email protected]>. (Thu, 17 Dec 2015 14:15:03 GMT) (full text, mbox, link).


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

From: "Michael Kerrisk (man-pages)" <[email protected]>
To: Vincent Lefevre <[email protected]>, [email protected]
Cc: [email protected], [email protected]
Subject: Re: Bug#803459: drand48(3): errors on interval bounds
Date: Thu, 17 Dec 2015 15:12:32 +0100
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/



Added tag(s) fixed-upstream. Request was from "Michael Kerrisk (man-pages)" <[email protected]> to [email protected]. (Thu, 17 Dec 2015 14:15:08 GMT) (full text, mbox, link).


Reply sent to "Dr. Tobias Quathamer" <[email protected]>:
You have taken responsibility. (Tue, 16 Feb 2016 20:36:05 GMT) (full text, mbox, link).


Notification sent to Vincent Lefevre <[email protected]>:
Bug acknowledged by developer. (Tue, 16 Feb 2016 20:36:05 GMT) (full text, mbox, link).


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

From: "Dr. Tobias Quathamer" <[email protected]>
To: [email protected]
Subject: drand48.3 is fixed now
Date: Tue, 16 Feb 2016 21:34:45 +0100
[Message part 1 (text/plain, inline)]
Version: 4.04-1

Hi,

this bug has been fixed in Debian, thanks for reporting.

Regards,
Tobias

[signature.asc (application/pgp-signature, attachment)]

Bug archived. Request was from Debbugs Internal Request <[email protected]> to [email protected]. (Wed, 16 Mar 2016 07:31:14 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Sat Sep 21 23:31:01 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.