From c35873501420a452152260a8d013e0ac47fbaf15 Mon Sep 17 00:00:00 2001 From: Marco Bodrato Date: Mon, 23 Nov 2020 19:29:14 +0100 Subject: doc/gmp.texi: Document mpz_prevprime (by Troisi) --- doc/gmp.texi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'doc') 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 -- cgit v1.2.1