[Gmp-commit] /var/hg/gmp: Tell users not to call factorial and primorial on n...

mercurial at gmplib.org mercurial at gmplib.org
Thu Nov 12 11:31:30 UTC 2015


details:   /var/hg/gmp/rev/cdf45e583489
changeset: 16959:cdf45e583489
user:      Marc Glisse <marc.glisse at inria.fr>
date:      Thu Nov 12 12:31:28 2015 +0100
description:
Tell users not to call factorial and primorial on negative numbers.

diffstat:

 ChangeLog    |  3 ++-
 doc/gmp.texi |  3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r f6cd9c29e66c -r cdf45e583489 ChangeLog
--- a/ChangeLog	Thu Nov 12 07:00:04 2015 +0100
+++ b/ChangeLog	Thu Nov 12 12:31:28 2015 +0100
@@ -4,7 +4,8 @@
 	(fibonacci, mpz_class::fibonacci): New functions.
 	(__gmp_fac_function, __gmp_primorial_function): Add braces.
 	* tests/cxx/t-ops2z.cc: Test fibonacci.
-	* doc/gmp.texi: Document fibonacci.
+	* doc/gmp.texi (C++ Interface Integers): Document fibonacci.
+	Warn about factorial and primorial of negative numbers.
 
 2015-11-10  Marc Glisse  <marc.glisse at inria.fr>
 
diff -r f6cd9c29e66c -r cdf45e583489 doc/gmp.texi
--- a/doc/gmp.texi	Thu Nov 12 07:00:04 2015 +0100
+++ b/doc/gmp.texi	Thu Nov 12 12:31:28 2015 +0100
@@ -6873,7 +6873,8 @@
 @deftypefunx void mpz_class::swap (mpz_class& @var{op})
 @deftypefunx void swap (mpz_class& @var{op1}, mpz_class& @var{op2})
 These functions provide a C++ class interface to the corresponding GMP C
-routines.
+routines.  Calling @code{factorial} or @code{primorial} on a negative number
+is undefined.
 
 @code{cmp} can be used with any of the classes or the standard C++ types,
 except @code{long long} and @code{long double}.


More information about the gmp-commit mailing list