From d084b8b837c56f5c4ca9c43afd109e6a0fd7d3eb Mon Sep 17 00:00:00 2001 From: Marco Bodrato Date: Thu, 29 Oct 2015 07:42:05 +0100 Subject: demos: Stop using undocumented mpz_div_2exp in example code. --- demos/factorize.c | 5 +++-- demos/perl/GMP.xs | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'demos') 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: -- cgit v1.2.1