summaryrefslogtreecommitdiff
path: root/src/mp.h
diff options
context:
space:
mode:
authormbkma <[email protected]>2020-10-05 10:30:58 +0200
committerRobert Antoni Buj Gelonch <[email protected]>2020-11-09 21:49:49 +0100
commit3ff75b9a3e85a4d7723b0de1f69345f3943070dd (patch)
treeef9c55e5efe6eaaf80c4398de457737e62c961aa /src/mp.h
parent81aa78009bcb2bc07abfb6cd3953e24ae3979dd8 (diff)
downloadmate-calc-3ff75b9a3e85a4d7723b0de1f69345f3943070dd.tar.bz2
mate-calc-3ff75b9a3e85a4d7723b0de1f69345f3943070dd.tar.xz
Improve factorization speed
- implements Miller-Rabin primality test - implements Pollard's rho algorithm to find prime factors - adds mp_new_from_integer function for convenience
Diffstat (limited to 'src/mp.h')
-rw-r--r--src/mp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mp.h b/src/mp.h
index 3e03089..8c527e3 100644
--- a/src/mp.h
+++ b/src/mp.h
@@ -69,6 +69,8 @@ void mperr(const char *format, ...) __attribute__((format(printf, 1, 2)))
/* Returns initialized MPNumber object */
MPNumber mp_new(void);
+MPNumber mp_new_from_integer(uint64_t x);
+
MPNumber* mp_new_ptr(void);
void mp_clear(MPNumber *z);