Bug#803459: drand48(3): errors on interval bounds

2015-12-17 Thread Michael Kerrisk (man-pages)
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/



Bug#803459: drand48(3): errors on interval bounds

2015-10-30 Thread Vincent Lefevre
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