diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2015-10-29 07:42:05 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2015-10-29 07:42:05 +0100 |
commit | d084b8b837c56f5c4ca9c43afd109e6a0fd7d3eb (patch) | |
tree | 928b7c07b12a8a2d3d85bde3a403aa8f910953af | |
parent | 70bd8d7c3f7c0288ba060651e1bb9e6ae06afd76 (diff) | |
download | gmp-d084b8b837c56f5c4ca9c43afd109e6a0fd7d3eb.tar.gz |
demos: Stop using undocumented mpz_div_2exp in example code.
-rw-r--r-- | demos/factorize.c | 5 | ||||
-rw-r--r-- | demos/perl/GMP.xs | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/demos/factorize.c b/demos/factorize.c index 0d5f26d90..91e645591 100644 --- a/demos/factorize.c +++ b/demos/factorize.c @@ -1,6 +1,7 @@ /* Factoring with Pollard's rho method. -Copyright 1995, 1997-2003, 2005, 2009, 2012 Free Software Foundation, Inc. +Copyright 1995, 1997-2003, 2005, 2009, 2012, 2015 Free Software +Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -131,7 +132,7 @@ factor_using_division (mpz_t t, struct factors *factors) mpz_init (q); p = mpz_scan1 (t, 0); - mpz_div_2exp (t, t, p); + mpz_fdiv_q_2exp (t, t, p); while (p) { factor_insert_ui (factors, 2); diff --git a/demos/perl/GMP.xs b/demos/perl/GMP.xs index 9738259c2..8f5acc914 100644 --- a/demos/perl/GMP.xs +++ b/demos/perl/GMP.xs @@ -1,6 +1,6 @@ /* GMP module external subroutines. -Copyright 2001-2003 Free Software Foundation, Inc. +Copyright 2001-2003, 2015 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -1627,7 +1627,7 @@ PREINIT: void (*op) (mpz_ptr, mpz_srcptr, unsigned long); } table[] = { { mpz_mul_2exp }, /* 0 */ - { mpz_div_2exp }, /* 1 */ + { mpz_fdiv_q_2exp }, /* 1 */ { mpz_pow_ui }, /* 2 */ }; CODE: @@ -1653,7 +1653,7 @@ PREINIT: void (*op) (mpz_ptr, mpz_srcptr, unsigned long); } table[] = { { mpz_mul_2exp }, /* 0 */ - { mpz_div_2exp }, /* 1 */ + { mpz_fdiv_q_2exp }, /* 1 */ { mpz_pow_ui }, /* 2 */ }; PPCODE: |