summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/rand48.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/rand48.3')
-rw-r--r--lib/libc/gen/rand48.39
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libc/gen/rand48.3 b/lib/libc/gen/rand48.3
index 86e7a2f..ac7e33e 100644
--- a/lib/libc/gen/rand48.3
+++ b/lib/libc/gen/rand48.3
@@ -50,7 +50,8 @@
The
.Fn rand48
family of functions generates pseudo-random numbers using a linear
-congruential algorithm working on integers 48 bits in size. The
+congruential algorithm working on integers 48 bits in size.
+The
particular formula employed is
r(n+1) = (a * r(n) + c) mod m
where the default values are
@@ -64,7 +65,8 @@ computational step is to perform a single iteration of the algorithm.
.Fn drand48
and
.Fn erand48
-return values of type double. The full 48 bits of r(n+1) are
+return values of type double.
+The full 48 bits of r(n+1) are
loaded into the mantissa of the returned value, with the exponent set
such that the values produced lie in the interval [0.0, 1.0).
.Pp
@@ -119,7 +121,8 @@ also initializes the internal buffer r(n) of
and
.Fn mrand48 ,
but here all 48 bits of the seed can be specified in an array of 3 shorts,
-where the zeroth member specifies the lowest bits. Again,
+where the zeroth member specifies the lowest bits.
+Again,
the constant multiplicand and addend of the algorithm are
reset to the default values given above.
.Fn seed48
OpenPOWER on IntegriCloud