summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2020-11-23 19:29:14 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2020-11-23 19:29:14 +0100
commitc35873501420a452152260a8d013e0ac47fbaf15 (patch)
treecddb394cc52d2eaf04d052a67adc0d0e263641c0 /doc
parentfa7469a0dace657f461c352fd029788de9e1148c (diff)
downloadgmp-c35873501420a452152260a8d013e0ac47fbaf15.tar.gz
doc/gmp.texi: Document mpz_prevprime (by Troisi)
Diffstat (limited to 'doc')
-rw-r--r--doc/gmp.texi13
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/gmp.texi b/doc/gmp.texi
index 6bca5da75..70672f34a 100644
--- a/doc/gmp.texi
+++ b/doc/gmp.texi
@@ -3563,8 +3563,19 @@ primality test. In those older versions of GMP, this function performed
@deftypefun void mpz_nextprime (mpz_t @var{rop}, const mpz_t @var{op})
@cindex Next prime function
Set @var{rop} to the next prime greater than @var{op}.
+@end deftypefun
+
+@deftypefun int mpz_prevprime (mpz_t @var{rop}, const mpz_t @var{op})
+@cindex Previous prime function
+Set @var{rop} to the greatest prime less than @var{op}.
+
+If a previous prime doesn't exist (i.e. @var{op} < 3), rop is unchanged and
+0 is returned.
+
+Return 1 if @var{rop} is a probably prime, and 2 if @var{rop} is definitely
+prime.
-This function uses a probabilistic algorithm to identify primes. For
+These functions use a probabilistic algorithm to identify primes. For
practical purposes it's adequate, the chance of a composite passing will be
extremely small.
@end deftypefun