summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/rand48.3
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1994-12-25 15:33:39 +0000
committerbde <bde@FreeBSD.org>1994-12-25 15:33:39 +0000
commit65d125f2c2609ccbbeb3ad398c4365389698a931 (patch)
tree3ad53845d465c07e018fa463a2779bbf781c6d5a /lib/libc/gen/rand48.3
parent4dcc6483b0c21b95f1b4e88458881c40ebb52445 (diff)
downloadFreeBSD-src-65d125f2c2609ccbbeb3ad398c4365389698a931.zip
FreeBSD-src-65d125f2c2609ccbbeb3ad398c4365389698a931.tar.gz
Fix the bug reported by Torbjorn Granlund <tege@cygnus.com>:
The documentation for mrand48 and lrand48 is mixed up. mrand48 returns a full 32 bit number, while lrand48 only returns 31 bits.
Diffstat (limited to 'lib/libc/gen/rand48.3')
-rw-r--r--lib/libc/gen/rand48.310
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/gen/rand48.3 b/lib/libc/gen/rand48.3
index 176303d..9fadeb2 100644
--- a/lib/libc/gen/rand48.3
+++ b/lib/libc/gen/rand48.3
@@ -71,16 +71,16 @@ such that the values produced lie in the interval [0.0, 1.0).
and
.Fn nrand48
return values of type long in the range
-[-2**31, 2**31-1]. The high-order (32) bits of
-r(n+1) are loaded into the returned value.
+[0, 2**31-1]. The high-order (31) bits of
+r(n+1) are loaded into the lower bits of the returned value, with
+the topmost (sign) bit set to zero.
.Pp
.Fn mrand48
and
.Fn jrand48
return values of type long in the range
-[0, 2**31-1]. The high-order (31) bits of
-r(n+1) are loaded into the lower bits of the returned value, with
-the topmost (sign) bit set to zero.
+[-2**31, 2**31-1]. The high-order (32) bits of
+r(n+1) are loaded into the returned value.
.Pp
.Fn drand48 ,
.Fn lrand48 ,
OpenPOWER on IntegriCloud