diff options
author | Damien George <damien.p.george@gmail.com> | 2016-10-11 13:11:32 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-10-11 13:11:32 +1100 |
commit | 8bb7d958f173eec58892bc00115516c160f93243 (patch) | |
tree | 6e17bda1e05c52ef8d627c3ca253055bce895a1f /py/mpz.h | |
parent | df3e5d2b2f8610d246fea348bb96e70f636183ea (diff) |
py: Factor duplicated function to calculate size of formatted int.
Diffstat (limited to 'py/mpz.h')
-rw-r--r-- | py/mpz.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -127,6 +127,7 @@ void mpz_or_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs); void mpz_xor_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs); void mpz_divmod_inpl(mpz_t *dest_quo, mpz_t *dest_rem, const mpz_t *lhs, const mpz_t *rhs); +static inline size_t mpz_max_num_bits(const mpz_t *z) { return z->len * MPZ_DIG_SIZE; } mp_int_t mpz_hash(const mpz_t *z); bool mpz_as_int_checked(const mpz_t *z, mp_int_t *value); bool mpz_as_uint_checked(const mpz_t *z, mp_uint_t *value); |