summaryrefslogtreecommitdiff
path: root/mpz/get_d.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-06-12 00:41:27 +0200
committerKevin Ryde <user42@zip.com.au>2001-06-12 00:41:27 +0200
commit34ed780a9e430fab19c52cbd7d2e6c5845302ecc (patch)
tree1d3aacb0718cc1d08385888376b4ffb6a7b3eb87 /mpz/get_d.c
parent61aaf5bfbec7c2d517a7c452a69d00347c3d4089 (diff)
downloadgmp-34ed780a9e430fab19c52cbd7d2e6c5845302ecc.tar.gz
* mpz/get_d.c: Add a private mpn_zero_p.
Diffstat (limited to 'mpz/get_d.c')
-rw-r--r--mpz/get_d.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mpz/get_d.c b/mpz/get_d.c
index 78e74c0e1..7a17c8651 100644
--- a/mpz/get_d.c
+++ b/mpz/get_d.c
@@ -24,6 +24,21 @@ MA 02111-1307, USA. */
#include "longlong.h"
+/* FIXME: Would prefer to inline this on all compilers, not just those with
+ "inline". */
+static inline int
+mpn_zero_p (mp_srcptr p, mp_size_t n)
+{
+ mp_size_t i;
+
+ for (i = 0; i < n; i++)
+ if (p[i] != 0)
+ return 0;
+
+ return 1;
+}
+
+
double
mpz_get_d (mpz_srcptr src)
{