summaryrefslogtreecommitdiff
path: root/gmp.texi
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>1999-05-24 18:04:33 +0200
committerLinus Nordberg <linus@nordberg.se>1999-05-24 18:04:33 +0200
commitaaba5ab26bd7729fb3d47627ee318ed31997dc54 (patch)
treeeed45fc2f6428eff60601aee69cbb4b6bb970cb0 /gmp.texi
parentdd651c2134d1e7d00371a41be8ad1dc0f508e5d4 (diff)
downloadgmp-aaba5ab26bd7729fb3d47627ee318ed31997dc54.tar.gz
Add some more on random number functions to gmp.texi.
Clean up mpn/generic/rawrandom.c.
Diffstat (limited to 'gmp.texi')
-rw-r--r--gmp.texi28
1 files changed, 27 insertions, 1 deletions
diff --git a/gmp.texi b/gmp.texi
index a8545182f..cc312c3c2 100644
--- a/gmp.texi
+++ b/gmp.texi
@@ -659,6 +659,12 @@ from the same seed are not truly independent.
See @ref{Random Number Functions} for a discussion on how to choose the
initial seed value passed to these functions.
+@deftypefun void gmp_rand_clear (gmp_rand_state @var{state})
+Free all memory occupied by @var{state}. Make sure to call this
+function for all @code{gmp_rand_state} variables when you are done with
+them.
+@end deftypefun
+
@deftypefun int gmp_rand_init (gmp_rand_state @var{state}, gmp_rand_algorithm @var{alg}, unsigned long int @var{size}, mpz_t @var{seed})
@deftypefunx int gmp_rand_init_ui (gmp_rand_state @var{state}, gmp_rand_algorithm @var{alg}, unsigned long int @var{size}, unsigned long int @var{seed})
@@ -710,7 +716,6 @@ When you're done with a @var{state} variable, call @code{gmp_rand_clear}
to deallocate any memory allocated by this function.
@end deftypefun
-
@node Reporting Bugs, Integer Functions, MP Basics, Top
@comment node-name, next, previous, up
@chapter Reporting Bugs
@@ -2477,6 +2482,17 @@ proven to be more likely to trigger corner-case bugs. Negative random numbers
are generated when @var{max_size} is negative.
@end deftypefun
+@deftypefun void mpf_urandomb (mpf_t @var{rop}, gmp_rand_state @var{state})
+Generate a universally distributed random float in the interval
+0 <= X < 1.
+
+The variable @var{state} must be initialized by calling one of the
+@code{gmp_rand_init} functions (@ref{Random State Initialization})
+before invoking this function.
+@end deftypefun
+
+
+
@c @deftypefun size_t mpf_size (mpf_t @var{op})
@c Return the size of @var{op} measured in number of limbs. If @var{op} is
@c zero, the returned value will be zero. (@xref{Nomenclature}, for an
@@ -2854,6 +2870,16 @@ The generated random numbers are intended for testing the correctness of the
implementation of the @code{mpn} routines.
@end deftypefun
+@deftypefun void mpn_rawrandom (mp_ptr @var{rp}, unsigned long int @var{nbits}, gmp_rand_state @var{state})
+Generate a universally distributed random number of size @var{nbits},
+and store it at @var{rp}.
+
+The variable @var{state} must be initialized by calling one of the
+@code{gmp_rand_init} functions (@ref{Random State Initialization})
+before invoking this function.
+@end deftypefun
+
+
@deftypefun {unsigned long int} mpn_popcount (const mp_limb_t *@var{s1p}, unsigned long int @var{size})
Count the number of set bits in @{@var{s1p}, @var{size}@}.
@end deftypefun