QtBigInt
Loading...
Searching...
No Matches
mini-gmp.c File Reference
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mini-gmp.h"
Include dependency graph for mini-gmp.c:

Go to the source code of this file.

Classes

struct  gmp_div_inverse
 
struct  mpn_base_info
 

Macros

#define GMP_LIMB_BITS   (sizeof(mp_limb_t) * CHAR_BIT)
 
#define GMP_LIMB_MAX   (~ (mp_limb_t) 0)
 
#define GMP_LIMB_HIGHBIT   ((mp_limb_t) 1 << (GMP_LIMB_BITS - 1))
 
#define GMP_HLIMB_BIT   ((mp_limb_t) 1 << (GMP_LIMB_BITS / 2))
 
#define GMP_LLIMB_MASK   (GMP_HLIMB_BIT - 1)
 
#define GMP_ULONG_BITS   (sizeof(uIntMpz) * CHAR_BIT)
 
#define GMP_ULONG_HIGHBIT   ((uIntMpz) 1 << (GMP_ULONG_BITS - 1))
 
#define GMP_ABS(x)   ((x) >= 0 ? (x) : -(x))
 
#define GMP_NEG_CAST(T, x)   (-((T)((x) + 1) - 1))
 
#define GMP_MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define GMP_MAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define GMP_CMP(a, b)   (((a) > (b)) - ((a) < (b)))
 
#define gmp_assert_nocarry(x)
 
#define gmp_clz(count, x)
 
#define gmp_ctz(count, x)
 
#define gmp_add_ssaaaa(sh, sl, ah, al, bh, bl)
 
#define gmp_sub_ddmmss(sh, sl, ah, al, bh, bl)
 
#define gmp_umul_ppmm(w1, w0, u, v)
 
#define gmp_udiv_qrnnd_preinv(q, r, nh, nl, d, di)
 
#define gmp_udiv_qr_3by2(q, r1, r0, n2, n1, n0, d1, d0, dinv)
 
#define MP_LIMB_T_SWAP(x, y)
 
#define MP_SIZE_T_SWAP(x, y)
 
#define MP_BITCNT_T_SWAP(x, y)
 
#define MP_PTR_SWAP(x, y)
 
#define MP_SRCPTR_SWAP(x, y)
 
#define MPN_PTR_SWAP(xp, xs, yp, ys)
 
#define MPN_SRCPTR_SWAP(xp, xs, yp, ys)
 
#define MPZ_PTR_SWAP(x, y)
 
#define MPZ_SRCPTR_SWAP(x, y)
 
#define gmp_xalloc(size)   ((*gmp_allocate_func)((size)))
 
#define gmp_free(p)   ((*gmp_free_func) ((p), 0))
 
#define MPZ_REALLOC(z, n)
 
#define GMP_PRIME_PRODUCT    (3UL*5UL*7UL*11UL*13UL*17UL*19UL*23UL*29UL)
 
#define GMP_PRIME_MASK   0xc96996dcUL
 

Enumerations

enum  mpz_div_round_mode { GMP_DIV_FLOOR , GMP_DIV_CEIL , GMP_DIV_TRUNC }
 

Functions

void mp_get_memory_functions (void *(**alloc_func)(size_t), void *(**realloc_func)(void *, size_t, size_t), void(**free_func)(void *, size_t))
 
void mp_set_memory_functions (void *(*alloc_func)(size_t), void *(*realloc_func)(void *, size_t, size_t), void(*free_func)(void *, size_t))
 
void mpn_copyi (mp_ptr d, mp_srcptr s, mp_size_t n)
 
void mpn_copyd (mp_ptr d, mp_srcptr s, mp_size_t n)
 
int mpn_cmp (mp_srcptr ap, mp_srcptr bp, mp_size_t n)
 
int mpn_zero_p (mp_srcptr rp, mp_size_t n)
 
void mpn_zero (mp_ptr rp, mp_size_t n)
 
mp_limb_t mpn_add_1 (mp_ptr rp, mp_srcptr ap, mp_size_t n, mp_limb_t b)
 
mp_limb_t mpn_add_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
 
mp_limb_t mpn_add (mp_ptr rp, mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn)
 
mp_limb_t mpn_sub_1 (mp_ptr rp, mp_srcptr ap, mp_size_t n, mp_limb_t b)
 
mp_limb_t mpn_sub_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
 
mp_limb_t mpn_sub (mp_ptr rp, mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn)
 
mp_limb_t mpn_mul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
 
mp_limb_t mpn_addmul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
 
mp_limb_t mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
 
mp_limb_t mpn_mul (mp_ptr rp, mp_srcptr up, mp_size_t un, mp_srcptr vp, mp_size_t vn)
 
void mpn_mul_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
 
void mpn_sqr (mp_ptr rp, mp_srcptr ap, mp_size_t n)
 
mp_limb_t mpn_lshift (mp_ptr rp, mp_srcptr up, mp_size_t n, unsigned int cnt)
 
mp_limb_t mpn_rshift (mp_ptr rp, mp_srcptr up, mp_size_t n, unsigned int cnt)
 
mp_bitcnt_t mpn_scan1 (mp_srcptr ptr, mp_bitcnt_t bit)
 
mp_bitcnt_t mpn_scan0 (mp_srcptr ptr, mp_bitcnt_t bit)
 
void mpn_com (mp_ptr rp, mp_srcptr up, mp_size_t n)
 
mp_limb_t mpn_neg (mp_ptr rp, mp_srcptr up, mp_size_t n)
 
mp_limb_t mpn_invert_3by2 (mp_limb_t u1, mp_limb_t u0)
 
size_t mpn_get_str (unsigned char *sp, int base, mp_ptr up, mp_size_t un)
 
mp_size_t mpn_set_str (mp_ptr rp, const unsigned char *sp, size_t sn, int base)
 
void mpz_init (mpz_t r)
 
void mpz_init2 (mpz_t r, mp_bitcnt_t bits)
 
void mpz_clear (mpz_t r)
 
void mpz_set_si (mpz_t r, intMpz x)
 
void mpz_set_ui (mpz_t r, uIntMpz x)
 
void mpz_set (mpz_t r, const mpz_t x)
 
void mpz_init_set_si (mpz_t r, intMpz x)
 
void mpz_init_set_ui (mpz_t r, uIntMpz x)
 
void mpz_init_set (mpz_t r, const mpz_t x)
 
int mpz_fits_slong_p (const mpz_t u)
 
int mpz_fits_ulong_p (const mpz_t u)
 
intMpz mpz_get_si (const mpz_t u)
 
uIntMpz mpz_get_ui (const mpz_t u)
 
size_t mpz_size (const mpz_t u)
 
mp_limb_t mpz_getlimbn (const mpz_t u, mp_size_t n)
 
void mpz_realloc2 (mpz_t x, mp_bitcnt_t n)
 
mp_srcptr mpz_limbs_read (mpz_srcptr x)
 
mp_ptr mpz_limbs_modify (mpz_t x, mp_size_t n)
 
mp_ptr mpz_limbs_write (mpz_t x, mp_size_t n)
 
void mpz_limbs_finish (mpz_t x, mp_size_t xs)
 
mpz_srcptr mpz_roinit_n (mpz_t x, mp_srcptr xp, mp_size_t xs)
 
void mpz_set_d (mpz_t r, double x)
 
void mpz_init_set_d (mpz_t r, double x)
 
double mpz_get_d (const mpz_t u)
 
int mpz_cmpabs_d (const mpz_t x, double d)
 
int mpz_cmp_d (const mpz_t x, double d)
 
int mpz_sgn (const mpz_t u)
 
int mpz_cmp_si (const mpz_t u, intMpz v)
 
int mpz_cmp_ui (const mpz_t u, uIntMpz v)
 
int mpz_cmp (const mpz_t a, const mpz_t b)
 
int mpz_cmpabs_ui (const mpz_t u, uIntMpz v)
 
int mpz_cmpabs (const mpz_t u, const mpz_t v)
 
void mpz_abs (mpz_t r, const mpz_t u)
 
void mpz_neg (mpz_t r, const mpz_t u)
 
void mpz_swap (mpz_t u, mpz_t v)
 
void mpz_add_ui (mpz_t r, const mpz_t a, uIntMpz b)
 
void mpz_sub_ui (mpz_t r, const mpz_t a, uIntMpz b)
 
void mpz_ui_sub (mpz_t r, uIntMpz a, const mpz_t b)
 
void mpz_add (mpz_t r, const mpz_t a, const mpz_t b)
 
void mpz_sub (mpz_t r, const mpz_t a, const mpz_t b)
 
void mpz_mul_si (mpz_t r, const mpz_t u, intMpz v)
 
void mpz_mul_ui (mpz_t r, const mpz_t u, uIntMpz v)
 
void mpz_mul (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_mul_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t bits)
 
void mpz_addmul_ui (mpz_t r, const mpz_t u, uIntMpz v)
 
void mpz_submul_ui (mpz_t r, const mpz_t u, uIntMpz v)
 
void mpz_addmul (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_submul (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_cdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_fdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_tdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_cdiv_q (mpz_t q, const mpz_t n, const mpz_t d)
 
void mpz_fdiv_q (mpz_t q, const mpz_t n, const mpz_t d)
 
void mpz_tdiv_q (mpz_t q, const mpz_t n, const mpz_t d)
 
void mpz_cdiv_r (mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_fdiv_r (mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_tdiv_r (mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_mod (mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_cdiv_q_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_fdiv_q_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_tdiv_q_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_cdiv_r_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_fdiv_r_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_tdiv_r_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_divexact (mpz_t q, const mpz_t n, const mpz_t d)
 
int mpz_divisible_p (const mpz_t n, const mpz_t d)
 
int mpz_congruent_p (const mpz_t a, const mpz_t b, const mpz_t m)
 
uIntMpz mpz_cdiv_qr_ui (mpz_t q, mpz_t r, const mpz_t n, uIntMpz d)
 
uIntMpz mpz_fdiv_qr_ui (mpz_t q, mpz_t r, const mpz_t n, uIntMpz d)
 
uIntMpz mpz_tdiv_qr_ui (mpz_t q, mpz_t r, const mpz_t n, uIntMpz d)
 
uIntMpz mpz_cdiv_q_ui (mpz_t q, const mpz_t n, uIntMpz d)
 
uIntMpz mpz_fdiv_q_ui (mpz_t q, const mpz_t n, uIntMpz d)
 
uIntMpz mpz_tdiv_q_ui (mpz_t q, const mpz_t n, uIntMpz d)
 
uIntMpz mpz_cdiv_r_ui (mpz_t r, const mpz_t n, uIntMpz d)
 
uIntMpz mpz_fdiv_r_ui (mpz_t r, const mpz_t n, uIntMpz d)
 
uIntMpz mpz_tdiv_r_ui (mpz_t r, const mpz_t n, uIntMpz d)
 
uIntMpz mpz_cdiv_ui (const mpz_t n, uIntMpz d)
 
uIntMpz mpz_fdiv_ui (const mpz_t n, uIntMpz d)
 
uIntMpz mpz_tdiv_ui (const mpz_t n, uIntMpz d)
 
uIntMpz mpz_mod_ui (mpz_t r, const mpz_t n, uIntMpz d)
 
void mpz_divexact_ui (mpz_t q, const mpz_t n, uIntMpz d)
 
int mpz_divisible_ui_p (const mpz_t n, uIntMpz d)
 
uIntMpz mpz_gcd_ui (mpz_t g, const mpz_t u, uIntMpz v)
 
void mpz_gcd (mpz_t g, const mpz_t u, const mpz_t v)
 
void mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, const mpz_t u, const mpz_t v)
 
void mpz_lcm (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_lcm_ui (mpz_t r, const mpz_t u, uIntMpz v)
 
int mpz_invert (mpz_t r, const mpz_t u, const mpz_t m)
 
void mpz_pow_ui (mpz_t r, const mpz_t b, uIntMpz e)
 
void mpz_ui_pow_ui (mpz_t r, uIntMpz blimb, uIntMpz e)
 
void mpz_powm (mpz_t r, const mpz_t b, const mpz_t e, const mpz_t m)
 
void mpz_powm_ui (mpz_t r, const mpz_t b, uIntMpz elimb, const mpz_t m)
 
void mpz_rootrem (mpz_t x, mpz_t r, const mpz_t y, uIntMpz z)
 
int mpz_root (mpz_t x, const mpz_t y, uIntMpz z)
 
void mpz_sqrtrem (mpz_t s, mpz_t r, const mpz_t u)
 
void mpz_sqrt (mpz_t s, const mpz_t u)
 
int mpz_perfect_square_p (const mpz_t u)
 
int mpn_perfect_square_p (mp_srcptr p, mp_size_t n)
 
mp_size_t mpn_sqrtrem (mp_ptr sp, mp_ptr rp, mp_srcptr p, mp_size_t n)
 
void mpz_fac_ui (mpz_t x, uIntMpz n)
 
void mpz_bin_uiui (mpz_t r, uIntMpz n, uIntMpz k)
 
int mpz_probab_prime_p (const mpz_t n, int reps)
 
int mpz_tstbit (const mpz_t d, mp_bitcnt_t bit_index)
 
void mpz_setbit (mpz_t d, mp_bitcnt_t bit_index)
 
void mpz_clrbit (mpz_t d, mp_bitcnt_t bit_index)
 
void mpz_combit (mpz_t d, mp_bitcnt_t bit_index)
 
void mpz_com (mpz_t r, const mpz_t u)
 
void mpz_and (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_ior (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_xor (mpz_t r, const mpz_t u, const mpz_t v)
 
mp_bitcnt_t mpn_popcount (mp_srcptr p, mp_size_t n)
 
mp_bitcnt_t mpz_popcount (const mpz_t u)
 
mp_bitcnt_t mpz_hamdist (const mpz_t u, const mpz_t v)
 
mp_bitcnt_t mpz_scan1 (const mpz_t u, mp_bitcnt_t starting_bit)
 
mp_bitcnt_t mpz_scan0 (const mpz_t u, mp_bitcnt_t starting_bit)
 
size_t mpz_sizeinbase (const mpz_t u, int base)
 
char * mpz_get_str (char *sp, int base, const mpz_t u)
 
int mpz_set_str (mpz_t r, const char *sp, int base)
 
int mpz_init_set_str (mpz_t r, const char *sp, int base)
 
size_t mpz_out_str (FILE *stream, int base, const mpz_t x)
 
void mpz_import (mpz_t r, size_t count, int order, size_t size, int endian, size_t nails, const void *src)
 
void * mpz_export (void *r, size_t *countp, int order, size_t size, int endian, size_t nails, const mpz_t u)
 

Variables

const int mp_bits_per_limb = GMP_LIMB_BITS
 

Macro Definition Documentation

◆ GMP_ABS

#define GMP_ABS (   x)    ((x) >= 0 ? (x) : -(x))

Definition at line 66 of file mini-gmp.c.

◆ gmp_add_ssaaaa

#define gmp_add_ssaaaa (   sh,
  sl,
  ah,
  al,
  bh,
  bl 
)
Value:
do { \
mp_limb_t __x; \
__x = (al) + (bl); \
(sh) = (ah) + (bh) + (__x < (al)); \
(sl) = __x; \
} while (0)
uIntMpz mp_limb_t
Definition: mini-gmp.h:61

Definition at line 98 of file mini-gmp.c.

◆ gmp_assert_nocarry

#define gmp_assert_nocarry (   x)
Value:
do { \
mp_limb_t __cy = (x); \
assert (__cy == 0); \
} while (0)

Definition at line 74 of file mini-gmp.c.

◆ gmp_clz

#define gmp_clz (   count,
 
)
Value:
do { \
mp_limb_t __clz_x = (x); \
unsigned __clz_c; \
for (__clz_c = 0; \
(__clz_x & ((mp_limb_t) 0xff << (GMP_LIMB_BITS - 8))) == 0; \
__clz_c += 8) \
__clz_x <<= 8; \
for (; (__clz_x & GMP_LIMB_HIGHBIT) == 0; __clz_c++) \
__clz_x <<= 1; \
(count) = __clz_c; \
} while (0)
#define GMP_LIMB_HIGHBIT
Definition: mini-gmp.c:58
#define GMP_LIMB_BITS
Definition: mini-gmp.c:55

Definition at line 79 of file mini-gmp.c.

◆ GMP_CMP

#define GMP_CMP (   a,
 
)    (((a) > (b)) - ((a) < (b)))

Definition at line 72 of file mini-gmp.c.

◆ gmp_ctz

#define gmp_ctz (   count,
 
)
Value:
do { \
mp_limb_t __ctz_x = (x); \
unsigned __ctz_c = 0; \
gmp_clz (__ctz_c, __ctz_x & - __ctz_x); \
(count) = GMP_LIMB_BITS - 1 - __ctz_c; \
} while (0)

Definition at line 91 of file mini-gmp.c.

◆ gmp_free

#define gmp_free (   p)    ((*gmp_free_func) ((p), 0))

Definition at line 325 of file mini-gmp.c.

◆ GMP_HLIMB_BIT

#define GMP_HLIMB_BIT   ((mp_limb_t) 1 << (GMP_LIMB_BITS / 2))

Definition at line 60 of file mini-gmp.c.

◆ GMP_LIMB_BITS

#define GMP_LIMB_BITS   (sizeof(mp_limb_t) * CHAR_BIT)

Definition at line 55 of file mini-gmp.c.

◆ GMP_LIMB_HIGHBIT

#define GMP_LIMB_HIGHBIT   ((mp_limb_t) 1 << (GMP_LIMB_BITS - 1))

Definition at line 58 of file mini-gmp.c.

◆ GMP_LIMB_MAX

#define GMP_LIMB_MAX   (~ (mp_limb_t) 0)

Definition at line 57 of file mini-gmp.c.

◆ GMP_LLIMB_MASK

#define GMP_LLIMB_MASK   (GMP_HLIMB_BIT - 1)

Definition at line 61 of file mini-gmp.c.

◆ GMP_MAX

#define GMP_MAX (   a,
 
)    ((a) > (b) ? (a) : (b))

Definition at line 70 of file mini-gmp.c.

◆ GMP_MIN

#define GMP_MIN (   a,
 
)    ((a) < (b) ? (a) : (b))

Definition at line 69 of file mini-gmp.c.

◆ GMP_NEG_CAST

#define GMP_NEG_CAST (   T,
 
)    (-((T)((x) + 1) - 1))

Definition at line 67 of file mini-gmp.c.

◆ GMP_PRIME_MASK

#define GMP_PRIME_MASK   0xc96996dcUL

Definition at line 3410 of file mini-gmp.c.

◆ GMP_PRIME_PRODUCT

#define GMP_PRIME_PRODUCT    (3UL*5UL*7UL*11UL*13UL*17UL*19UL*23UL*29UL)

Definition at line 3406 of file mini-gmp.c.

◆ gmp_sub_ddmmss

#define gmp_sub_ddmmss (   sh,
  sl,
  ah,
  al,
  bh,
  bl 
)
Value:
do { \
mp_limb_t __x; \
__x = (al) - (bl); \
(sh) = (ah) - (bh) - ((al) < (bl)); \
(sl) = __x; \
} while (0)

Definition at line 106 of file mini-gmp.c.

◆ gmp_udiv_qr_3by2

#define gmp_udiv_qr_3by2 (   q,
  r1,
  r0,
  n2,
  n1,
  n0,
  d1,
  d0,
  dinv 
)
Value:
do { \
mp_limb_t _q0, _t1, _t0, _mask; \
gmp_umul_ppmm ((q), _q0, (n2), (dinv)); \
gmp_add_ssaaaa ((q), _q0, (q), _q0, (n2), (n1)); \
\
/* Compute the two most significant limbs of n - q'd */ \
(r1) = (n1) - (d1) * (q); \
gmp_sub_ddmmss ((r1), (r0), (r1), (n0), (d1), (d0)); \
gmp_umul_ppmm (_t1, _t0, (d0), (q)); \
gmp_sub_ddmmss ((r1), (r0), (r1), (r0), _t1, _t0); \
(q)++; \
\
/* Conditionally adjust q and the remainders */ \
_mask = - (mp_limb_t) ((r1) >= _q0); \
(q) += _mask; \
gmp_add_ssaaaa ((r1), (r0), (r1), (r0), _mask & (d1), _mask & (d0)); \
if ((r1) >= (d1)) \
{ \
if ((r1) > (d1) || (r0) >= (d0)) \
{ \
(q)++; \
gmp_sub_ddmmss ((r1), (r0), (r1), (r0), (d1), (d0)); \
} \
} \
} while (0)

Definition at line 158 of file mini-gmp.c.

◆ gmp_udiv_qrnnd_preinv

#define gmp_udiv_qrnnd_preinv (   q,
  r,
  nh,
  nl,
  d,
  di 
)
Value:
do { \
mp_limb_t _qh, _ql, _r, _mask; \
gmp_umul_ppmm (_qh, _ql, (nh), (di)); \
gmp_add_ssaaaa (_qh, _ql, _qh, _ql, (nh) + 1, (nl)); \
_r = (nl) - _qh * (d); \
_mask = -(mp_limb_t) (_r > _ql); /* both > and >= are OK */ \
_qh += _mask; \
_r += _mask & (d); \
if (_r >= (d)) \
{ \
_r -= (d); \
_qh++; \
} \
\
(r) = _r; \
(q) = _qh; \
} while (0)

Definition at line 139 of file mini-gmp.c.

◆ GMP_ULONG_BITS

#define GMP_ULONG_BITS   (sizeof(uIntMpz) * CHAR_BIT)

Definition at line 63 of file mini-gmp.c.

◆ GMP_ULONG_HIGHBIT

#define GMP_ULONG_HIGHBIT   ((uIntMpz) 1 << (GMP_ULONG_BITS - 1))

Definition at line 64 of file mini-gmp.c.

◆ gmp_umul_ppmm

#define gmp_umul_ppmm (   w1,
  w0,
  u,
 
)
Value:
do { \
mp_limb_t __x0, __x1, __x2, __x3; \
unsigned __ul, __vl, __uh, __vh; \
mp_limb_t __u = (u), __v = (v); \
\
__ul = __u & GMP_LLIMB_MASK; \
__uh = __u >> (GMP_LIMB_BITS / 2); \
__vl = __v & GMP_LLIMB_MASK; \
__vh = __v >> (GMP_LIMB_BITS / 2); \
\
__x0 = (mp_limb_t) __ul * __vl; \
__x1 = (mp_limb_t) __ul * __vh; \
__x2 = (mp_limb_t) __uh * __vl; \
__x3 = (mp_limb_t) __uh * __vh; \
\
__x1 += __x0 >> (GMP_LIMB_BITS / 2);/* this can't give carry */ \
__x1 += __x2; /* but this indeed can */ \
if (__x1 < __x2) /* did we get it? */ \
__x3 += GMP_HLIMB_BIT; /* yes, add it in the proper pos. */ \
\
(w1) = __x3 + (__x1 >> (GMP_LIMB_BITS / 2)); \
(w0) = (__x1 << (GMP_LIMB_BITS / 2)) + (__x0 & GMP_LLIMB_MASK); \
} while (0)
#define GMP_LLIMB_MASK
Definition: mini-gmp.c:61
#define GMP_HLIMB_BIT
Definition: mini-gmp.c:60

Definition at line 114 of file mini-gmp.c.

◆ gmp_xalloc

#define gmp_xalloc (   size)    ((*gmp_allocate_func)((size)))

Definition at line 324 of file mini-gmp.c.

◆ MP_BITCNT_T_SWAP

#define MP_BITCNT_T_SWAP (   x,
 
)
Value:
do { \
mp_bitcnt_t __mp_bitcnt_t_swap__tmp = (x); \
(x) = (y); \
(y) = __mp_bitcnt_t_swap__tmp; \
} while (0)
uIntMpz mp_bitcnt_t
Definition: mini-gmp.h:63

Definition at line 198 of file mini-gmp.c.

◆ MP_LIMB_T_SWAP

#define MP_LIMB_T_SWAP (   x,
 
)
Value:
do { \
mp_limb_t __mp_limb_t_swap__tmp = (x); \
(x) = (y); \
(y) = __mp_limb_t_swap__tmp; \
} while (0)

Definition at line 186 of file mini-gmp.c.

◆ MP_PTR_SWAP

#define MP_PTR_SWAP (   x,
 
)
Value:
do { \
mp_ptr __mp_ptr_swap__tmp = (x); \
(x) = (y); \
(y) = __mp_ptr_swap__tmp; \
} while (0)
mp_limb_t * mp_ptr
Definition: mini-gmp.h:65

Definition at line 204 of file mini-gmp.c.

◆ MP_SIZE_T_SWAP

#define MP_SIZE_T_SWAP (   x,
 
)
Value:
do { \
mp_size_t __mp_size_t_swap__tmp = (x); \
(x) = (y); \
(y) = __mp_size_t_swap__tmp; \
} while (0)
intMpz mp_size_t
Definition: mini-gmp.h:62

Definition at line 192 of file mini-gmp.c.

◆ MP_SRCPTR_SWAP

#define MP_SRCPTR_SWAP (   x,
 
)
Value:
do { \
mp_srcptr __mp_srcptr_swap__tmp = (x); \
(x) = (y); \
(y) = __mp_srcptr_swap__tmp; \
} while (0)
const mp_limb_t * mp_srcptr
Definition: mini-gmp.h:66

Definition at line 210 of file mini-gmp.c.

◆ MPN_PTR_SWAP

#define MPN_PTR_SWAP (   xp,
  xs,
  yp,
  ys 
)
Value:
do { \
MP_PTR_SWAP (xp, yp); \
MP_SIZE_T_SWAP (xs, ys); \
} while(0)

Definition at line 217 of file mini-gmp.c.

◆ MPN_SRCPTR_SWAP

#define MPN_SRCPTR_SWAP (   xp,
  xs,
  yp,
  ys 
)
Value:
do { \
MP_SRCPTR_SWAP (xp, yp); \
MP_SIZE_T_SWAP (xs, ys); \
} while(0)

Definition at line 222 of file mini-gmp.c.

◆ MPZ_PTR_SWAP

#define MPZ_PTR_SWAP (   x,
 
)
Value:
do { \
mpz_ptr __mpz_ptr_swap__tmp = (x); \
(x) = (y); \
(y) = __mpz_ptr_swap__tmp; \
} while (0)

Definition at line 228 of file mini-gmp.c.

◆ MPZ_REALLOC

#define MPZ_REALLOC (   z,
 
)
Value:
((n) > (z)->_mp_alloc \
? mpz_realloc(z,n) \
: (z)->_mp_d)

Definition at line 1474 of file mini-gmp.c.

◆ MPZ_SRCPTR_SWAP

#define MPZ_SRCPTR_SWAP (   x,
 
)
Value:
do { \
mpz_srcptr __mpz_srcptr_swap__tmp = (x); \
(x) = (y); \
(y) = __mpz_srcptr_swap__tmp; \
} while (0)

Definition at line 234 of file mini-gmp.c.

Enumeration Type Documentation

◆ mpz_div_round_mode

Enumerator
GMP_DIV_FLOOR 
GMP_DIV_CEIL 
GMP_DIV_TRUNC 

Definition at line 2171 of file mini-gmp.c.

Function Documentation

◆ mp_get_memory_functions()

void mp_get_memory_functions ( void *(**)(size_t)  alloc_func,
void *(**)(void *, size_t, size_t)  realloc_func,
void(**)(void *, size_t)  free_func 
)

Definition at line 293 of file mini-gmp.c.

◆ mp_set_memory_functions()

void mp_set_memory_functions ( void *(*)(size_t)  alloc_func,
void *(*)(void *, size_t, size_t)  realloc_func,
void(*)(void *, size_t)  free_func 
)

Definition at line 308 of file mini-gmp.c.

◆ mpn_add()

mp_limb_t mpn_add ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  an,
mp_srcptr  bp,
mp_size_t  bn 
)

Definition at line 438 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpn_add_1()

mp_limb_t mpn_add_1 ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  n,
mp_limb_t  b 
)

Definition at line 400 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_add_n()

mp_limb_t mpn_add_n ( mp_ptr  rp,
mp_srcptr  ap,
mp_srcptr  bp,
mp_size_t  n 
)

Definition at line 419 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_addmul_1()

mp_limb_t mpn_addmul_1 ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
mp_limb_t  vl 
)

Definition at line 526 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_cmp()

int mpn_cmp ( mp_srcptr  ap,
mp_srcptr  bp,
mp_size_t  n 
)

Definition at line 359 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_com()

void mpn_com ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n 
)

Definition at line 710 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_copyd()

void mpn_copyd ( mp_ptr  d,
mp_srcptr  s,
mp_size_t  n 
)

Definition at line 352 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_copyi()

void mpn_copyi ( mp_ptr  d,
mp_srcptr  s,
mp_size_t  n 
)

Definition at line 344 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_get_str()

size_t mpn_get_str ( unsigned char *  sp,
int  base,
mp_ptr  up,
mp_size_t  un 
)

Definition at line 1312 of file mini-gmp.c.

◆ mpn_invert_3by2()

mp_limb_t mpn_invert_3by2 ( mp_limb_t  u1,
mp_limb_t  u0 
)

Definition at line 739 of file mini-gmp.c.

◆ mpn_lshift()

mp_limb_t mpn_lshift ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
unsigned int  cnt 
)

Definition at line 613 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_mul()

mp_limb_t mpn_mul ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  un,
mp_srcptr  vp,
mp_size_t  vn 
)

Definition at line 578 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpn_mul_1()

mp_limb_t mpn_mul_1 ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
mp_limb_t  vl 
)

Definition at line 503 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_mul_n()

void mpn_mul_n ( mp_ptr  rp,
mp_srcptr  ap,
mp_srcptr  bp,
mp_size_t  n 
)

Definition at line 601 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpn_neg()

mp_limb_t mpn_neg ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n 
)

Definition at line 717 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpn_perfect_square_p()

int mpn_perfect_square_p ( mp_srcptr  p,
mp_size_t  n 
)

Definition at line 3315 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpn_popcount()

mp_bitcnt_t mpn_popcount ( mp_srcptr  p,
mp_size_t  n 
)

Definition at line 3865 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_rshift()

mp_limb_t mpn_rshift ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
unsigned int  cnt 
)

Definition at line 643 of file mini-gmp.c.

◆ mpn_scan0()

mp_bitcnt_t mpn_scan0 ( mp_srcptr  ptr,
mp_bitcnt_t  bit 
)

Definition at line 700 of file mini-gmp.c.

◆ mpn_scan1()

mp_bitcnt_t mpn_scan1 ( mp_srcptr  ptr,
mp_bitcnt_t  bit 
)

Definition at line 690 of file mini-gmp.c.

◆ mpn_set_str()

mp_size_t mpn_set_str ( mp_ptr  rp,
const unsigned char *  sp,
size_t  sn,
int  base 
)

Definition at line 1403 of file mini-gmp.c.

◆ mpn_sqr()

void mpn_sqr ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  n 
)

Definition at line 607 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpn_sqrtrem()

mp_size_t mpn_sqrtrem ( mp_ptr  sp,
mp_ptr  rp,
mp_srcptr  p,
mp_size_t  n 
)

Definition at line 3325 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpn_sub()

mp_limb_t mpn_sub ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  an,
mp_srcptr  bp,
mp_size_t  bn 
)

Definition at line 490 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpn_sub_1()

mp_limb_t mpn_sub_1 ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  n,
mp_limb_t  b 
)

Definition at line 451 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_sub_n()

mp_limb_t mpn_sub_n ( mp_ptr  rp,
mp_srcptr  ap,
mp_srcptr  bp,
mp_size_t  n 
)

Definition at line 472 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_submul_1()

mp_limb_t mpn_submul_1 ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
mp_limb_t  vl 
)

Definition at line 552 of file mini-gmp.c.

◆ mpn_zero()

void mpn_zero ( mp_ptr  rp,
mp_size_t  n 
)

Definition at line 393 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpn_zero_p()

int mpn_zero_p ( mp_srcptr  rp,
mp_size_t  n 
)

Definition at line 387 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_abs()

void mpz_abs ( mpz_t  r,
const mpz_t  u 
)

Definition at line 1844 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_add()

void mpz_add ( mpz_t  r,
const mpz_t  a,
const mpz_t  b 
)

Definition at line 1993 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_add_ui()

void mpz_add_ui ( mpz_t  r,
const mpz_t  a,
uIntMpz  b 
)

Definition at line 1919 of file mini-gmp.c.

◆ mpz_addmul()

void mpz_addmul ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

Definition at line 2150 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_addmul_ui()

void mpz_addmul_ui ( mpz_t  r,
const mpz_t  u,
uIntMpz  v 
)

Definition at line 2130 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_and()

void mpz_and ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

Definition at line 3634 of file mini-gmp.c.

◆ mpz_bin_uiui()

void mpz_bin_uiui ( mpz_t  r,
uIntMpz  n,
uIntMpz  k 
)

Definition at line 3358 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_cdiv_q()

void mpz_cdiv_q ( mpz_t  q,
const mpz_t  n,
const mpz_t  d 
)

Definition at line 2305 of file mini-gmp.c.

◆ mpz_cdiv_q_2exp()

void mpz_cdiv_q_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)

Definition at line 2471 of file mini-gmp.c.

◆ mpz_cdiv_q_ui()

uIntMpz mpz_cdiv_q_ui ( mpz_t  q,
const mpz_t  n,
uIntMpz  d 
)

Definition at line 2611 of file mini-gmp.c.

◆ mpz_cdiv_qr()

void mpz_cdiv_qr ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

Definition at line 2287 of file mini-gmp.c.

◆ mpz_cdiv_qr_ui()

uIntMpz mpz_cdiv_qr_ui ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
uIntMpz  d 
)

Definition at line 2593 of file mini-gmp.c.

◆ mpz_cdiv_r()

void mpz_cdiv_r ( mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

Definition at line 2323 of file mini-gmp.c.

◆ mpz_cdiv_r_2exp()

void mpz_cdiv_r_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)

Definition at line 2489 of file mini-gmp.c.

◆ mpz_cdiv_r_ui()

uIntMpz mpz_cdiv_r_ui ( mpz_t  r,
const mpz_t  n,
uIntMpz  d 
)

Definition at line 2629 of file mini-gmp.c.

◆ mpz_cdiv_ui()

uIntMpz mpz_cdiv_ui ( const mpz_t  n,
uIntMpz  d 
)

Definition at line 2645 of file mini-gmp.c.

◆ mpz_clear()

void mpz_clear ( mpz_t  r)

Definition at line 1450 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_clrbit()

void mpz_clrbit ( mpz_t  d,
mp_bitcnt_t  bit_index 
)

Definition at line 3606 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_cmp()

int mpz_cmp ( const mpz_t  a,
const mpz_t  b 
)

Definition at line 1814 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_cmp_d()

int mpz_cmp_d ( const mpz_t  x,
double  d 
)

Definition at line 1759 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_cmp_si()

int mpz_cmp_si ( const mpz_t  u,
intMpz  v 
)

Definition at line 1786 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_cmp_ui()

int mpz_cmp_ui ( const mpz_t  u,
uIntMpz  v 
)

Definition at line 1801 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_cmpabs()

int mpz_cmpabs ( const mpz_t  u,
const mpz_t  v 
)

Definition at line 1837 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_cmpabs_d()

int mpz_cmpabs_d ( const mpz_t  x,
double  d 
)

Definition at line 1718 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_cmpabs_ui()

int mpz_cmpabs_ui ( const mpz_t  u,
uIntMpz  v 
)

Definition at line 1828 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_com()

void mpz_com ( mpz_t  r,
const mpz_t  u 
)

Definition at line 3627 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_combit()

void mpz_combit ( mpz_t  d,
mp_bitcnt_t  bit_index 
)

Definition at line 3618 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_congruent_p()

int mpz_congruent_p ( const mpz_t  a,
const mpz_t  b,
const mpz_t  m 
)

Definition at line 2519 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_divexact()

void mpz_divexact ( mpz_t  q,
const mpz_t  n,
const mpz_t  d 
)

Definition at line 2507 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_divexact_ui()

void mpz_divexact_ui ( mpz_t  q,
const mpz_t  n,
uIntMpz  d 
)

Definition at line 2669 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_divisible_p()

int mpz_divisible_p ( const mpz_t  n,
const mpz_t  d 
)

Definition at line 2513 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_divisible_ui_p()

int mpz_divisible_ui_p ( const mpz_t  n,
uIntMpz  d 
)

Definition at line 2675 of file mini-gmp.c.

◆ mpz_export()

void * mpz_export ( void *  r,
size_t *  countp,
int  order,
size_t  size,
int  endian,
size_t  nails,
const mpz_t  u 
)

Definition at line 4329 of file mini-gmp.c.

◆ mpz_fac_ui()

void mpz_fac_ui ( mpz_t  x,
uIntMpz  n 
)

Definition at line 3350 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_fdiv_q()

void mpz_fdiv_q ( mpz_t  q,
const mpz_t  n,
const mpz_t  d 
)

Definition at line 2311 of file mini-gmp.c.

◆ mpz_fdiv_q_2exp()

void mpz_fdiv_q_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)

Definition at line 2477 of file mini-gmp.c.

◆ mpz_fdiv_q_ui()

uIntMpz mpz_fdiv_q_ui ( mpz_t  q,
const mpz_t  n,
uIntMpz  d 
)

Definition at line 2617 of file mini-gmp.c.

◆ mpz_fdiv_qr()

void mpz_fdiv_qr ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

Definition at line 2293 of file mini-gmp.c.

◆ mpz_fdiv_qr_ui()

uIntMpz mpz_fdiv_qr_ui ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
uIntMpz  d 
)

Definition at line 2599 of file mini-gmp.c.

◆ mpz_fdiv_r()

void mpz_fdiv_r ( mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

Definition at line 2329 of file mini-gmp.c.

◆ mpz_fdiv_r_2exp()

void mpz_fdiv_r_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)

Definition at line 2495 of file mini-gmp.c.

◆ mpz_fdiv_r_ui()

uIntMpz mpz_fdiv_r_ui ( mpz_t  r,
const mpz_t  n,
uIntMpz  d 
)

Definition at line 2634 of file mini-gmp.c.

◆ mpz_fdiv_ui()

uIntMpz mpz_fdiv_ui ( const mpz_t  n,
uIntMpz  d 
)

Definition at line 2651 of file mini-gmp.c.

◆ mpz_fits_slong_p()

int mpz_fits_slong_p ( const mpz_t  u)

Definition at line 1542 of file mini-gmp.c.

◆ mpz_fits_ulong_p()

int mpz_fits_ulong_p ( const mpz_t  u)

Definition at line 1555 of file mini-gmp.c.

◆ mpz_gcd()

void mpz_gcd ( mpz_t  g,
const mpz_t  u,
const mpz_t  v 
)

Definition at line 2762 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_gcd_ui()

uIntMpz mpz_gcd_ui ( mpz_t  g,
const mpz_t  u,
uIntMpz  v 
)

Definition at line 2726 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_gcdext()

void mpz_gcdext ( mpz_t  g,
mpz_t  s,
mpz_t  t,
const mpz_t  u,
const mpz_t  v 
)

Definition at line 2825 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_get_d()

double mpz_get_d ( const mpz_t  u)

Definition at line 1696 of file mini-gmp.c.

◆ mpz_get_si()

intMpz mpz_get_si ( const mpz_t  u)

Definition at line 1563 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_get_str()

char * mpz_get_str ( char *  sp,
int  base,
const mpz_t  u 
)

Definition at line 4062 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_get_ui()

uIntMpz mpz_get_ui ( const mpz_t  u)

Definition at line 1573 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_getlimbn()

mp_limb_t mpz_getlimbn ( const mpz_t  u,
mp_size_t  n 
)

Definition at line 1585 of file mini-gmp.c.

◆ mpz_hamdist()

mp_bitcnt_t mpz_hamdist ( const mpz_t  u,
const mpz_t  v 
)

Definition at line 3890 of file mini-gmp.c.

◆ mpz_import()

void mpz_import ( mpz_t  r,
size_t  count,
int  order,
size_t  size,
int  endian,
size_t  nails,
const void *  src 
)

Definition at line 4261 of file mini-gmp.c.

◆ mpz_init()

void mpz_init ( mpz_t  r)

Definition at line 1425 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_init2()

void mpz_init2 ( mpz_t  r,
mp_bitcnt_t  bits 
)

Definition at line 1437 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_init_set()

void mpz_init_set ( mpz_t  r,
const mpz_t  x 
)

Definition at line 1535 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_init_set_d()

void mpz_init_set_d ( mpz_t  r,
double  x 
)

Definition at line 1689 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_init_set_si()

void mpz_init_set_si ( mpz_t  r,
intMpz  x 
)

Definition at line 1521 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_init_set_str()

int mpz_init_set_str ( mpz_t  r,
const char *  sp,
int  base 
)

Definition at line 4231 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_init_set_ui()

void mpz_init_set_ui ( mpz_t  r,
uIntMpz  x 
)

Definition at line 1528 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_invert()

int mpz_invert ( mpz_t  r,
const mpz_t  u,
const mpz_t  m 
)

Definition at line 3043 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_ior()

void mpz_ior ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

Definition at line 3706 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_lcm()

void mpz_lcm ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

Definition at line 3007 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_lcm_ui()

void mpz_lcm_ui ( mpz_t  r,
const mpz_t  u,
uIntMpz  v 
)

Definition at line 3028 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_limbs_finish()

void mpz_limbs_finish ( mpz_t  x,
mp_size_t  xs 
)

Definition at line 1619 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_limbs_modify()

mp_ptr mpz_limbs_modify ( mpz_t  x,
mp_size_t  n 
)

Definition at line 1606 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_limbs_read()

mp_srcptr mpz_limbs_read ( mpz_srcptr  x)

Definition at line 1600 of file mini-gmp.c.

◆ mpz_limbs_write()

mp_ptr mpz_limbs_write ( mpz_t  x,
mp_size_t  n 
)

Definition at line 1613 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_mod()

void mpz_mod ( mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

Definition at line 2341 of file mini-gmp.c.

◆ mpz_mod_ui()

uIntMpz mpz_mod_ui ( mpz_t  r,
const mpz_t  n,
uIntMpz  d 
)

Definition at line 2663 of file mini-gmp.c.

◆ mpz_mul()

void mpz_mul ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

Definition at line 2058 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_mul_2exp()

void mpz_mul_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  bits 
)

Definition at line 2096 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_mul_si()

void mpz_mul_si ( mpz_t  r,
const mpz_t  u,
intMpz  v 
)

Definition at line 2021 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_mul_ui()

void mpz_mul_ui ( mpz_t  r,
const mpz_t  u,
uIntMpz  v 
)

Definition at line 2033 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_neg()

void mpz_neg ( mpz_t  r,
const mpz_t  u 
)

Definition at line 1851 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_out_str()

size_t mpz_out_str ( FILE *  stream,
int  base,
const mpz_t  x 
)

Definition at line 4238 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_perfect_square_p()

int mpz_perfect_square_p ( const mpz_t  u)

Definition at line 3306 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_popcount()

mp_bitcnt_t mpz_popcount ( const mpz_t  u)

Definition at line 3877 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_pow_ui()

void mpz_pow_ui ( mpz_t  r,
const mpz_t  b,
uIntMpz  e 
)

Definition at line 3078 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_powm()

void mpz_powm ( mpz_t  r,
const mpz_t  b,
const mpz_t  e,
const mpz_t  m 
)

Definition at line 3106 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_powm_ui()

void mpz_powm_ui ( mpz_t  r,
const mpz_t  b,
uIntMpz  elimb,
const mpz_t  m 
)

Definition at line 3211 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_probab_prime_p()

int mpz_probab_prime_p ( const mpz_t  n,
int  reps 
)

Definition at line 3413 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_realloc2()

void mpz_realloc2 ( mpz_t  x,
mp_bitcnt_t  n 
)

Definition at line 1594 of file mini-gmp.c.

◆ mpz_roinit_n()

mpz_srcptr mpz_roinit_n ( mpz_t  x,
mp_srcptr  xp,
mp_size_t  xs 
)

Definition at line 1627 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_root()

int mpz_root ( mpz_t  x,
const mpz_t  y,
uIntMpz  z 
)

Definition at line 3279 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_rootrem()

void mpz_rootrem ( mpz_t  x,
mpz_t  r,
const mpz_t  y,
uIntMpz  z 
)

Definition at line 3219 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_scan0()

mp_bitcnt_t mpz_scan0 ( const mpz_t  u,
mp_bitcnt_t  starting_bit 
)

Definition at line 3977 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_scan1()

mp_bitcnt_t mpz_scan1 ( const mpz_t  u,
mp_bitcnt_t  starting_bit 
)

Definition at line 3941 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_set()

void mpz_set ( mpz_t  r,
const mpz_t  x 
)

Definition at line 1504 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_set_d()

void mpz_set_d ( mpz_t  r,
double  x 
)

Definition at line 1638 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_set_si()

void mpz_set_si ( mpz_t  r,
intMpz  x 
)

Definition at line 1480 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_set_str()

int mpz_set_str ( mpz_t  r,
const char *  sp,
int  base 
)

Definition at line 4127 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_set_ui()

void mpz_set_ui ( mpz_t  r,
uIntMpz  x 
)

Definition at line 1492 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_setbit()

void mpz_setbit ( mpz_t  d,
mp_bitcnt_t  bit_index 
)

Definition at line 3594 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_sgn()

int mpz_sgn ( const mpz_t  u)

Definition at line 1780 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_size()

size_t mpz_size ( const mpz_t  u)

Definition at line 1579 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_sizeinbase()

size_t mpz_sizeinbase ( const mpz_t  u,
int  base 
)

Definition at line 4009 of file mini-gmp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mpz_sqrt()

void mpz_sqrt ( mpz_t  s,
const mpz_t  u 
)

Definition at line 3300 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_sqrtrem()

void mpz_sqrtrem ( mpz_t  s,
mpz_t  r,
const mpz_t  u 
)

Definition at line 3294 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_sub()

void mpz_sub ( mpz_t  r,
const mpz_t  a,
const mpz_t  b 
)

Definition at line 2006 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_sub_ui()

void mpz_sub_ui ( mpz_t  r,
const mpz_t  a,
uIntMpz  b 
)

Definition at line 1928 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_submul()

void mpz_submul ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

Definition at line 2160 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_submul_ui()

void mpz_submul_ui ( mpz_t  r,
const mpz_t  u,
uIntMpz  v 
)

Definition at line 2140 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_swap()

void mpz_swap ( mpz_t  u,
mpz_t  v 
)

Definition at line 1858 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_tdiv_q()

void mpz_tdiv_q ( mpz_t  q,
const mpz_t  n,
const mpz_t  d 
)

Definition at line 2317 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_tdiv_q_2exp()

void mpz_tdiv_q_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)

Definition at line 2483 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_tdiv_q_ui()

uIntMpz mpz_tdiv_q_ui ( mpz_t  q,
const mpz_t  n,
uIntMpz  d 
)

Definition at line 2623 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_tdiv_qr()

void mpz_tdiv_qr ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

Definition at line 2299 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_tdiv_qr_ui()

uIntMpz mpz_tdiv_qr_ui ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
uIntMpz  d 
)

Definition at line 2605 of file mini-gmp.c.

◆ mpz_tdiv_r()

void mpz_tdiv_r ( mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

Definition at line 2335 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_tdiv_r_2exp()

void mpz_tdiv_r_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)

Definition at line 2501 of file mini-gmp.c.

◆ mpz_tdiv_r_ui()

uIntMpz mpz_tdiv_r_ui ( mpz_t  r,
const mpz_t  n,
uIntMpz  d 
)

Definition at line 2639 of file mini-gmp.c.

◆ mpz_tdiv_ui()

uIntMpz mpz_tdiv_ui ( const mpz_t  n,
uIntMpz  d 
)

Definition at line 2657 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_tstbit()

int mpz_tstbit ( const mpz_t  d,
mp_bitcnt_t  bit_index 
)

Definition at line 3499 of file mini-gmp.c.

Here is the caller graph for this function:

◆ mpz_ui_pow_ui()

void mpz_ui_pow_ui ( mpz_t  r,
uIntMpz  blimb,
uIntMpz  e 
)

Definition at line 3099 of file mini-gmp.c.

Here is the call graph for this function:

◆ mpz_ui_sub()

void mpz_ui_sub ( mpz_t  r,
uIntMpz  a,
const mpz_t  b 
)

Definition at line 1937 of file mini-gmp.c.

◆ mpz_xor()

void mpz_xor ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

Definition at line 3779 of file mini-gmp.c.

Here is the call graph for this function:

Variable Documentation

◆ mp_bits_per_limb

const int mp_bits_per_limb = GMP_LIMB_BITS

Definition at line 241 of file mini-gmp.c.