1 module deimos.gmp.integer;
2 
3 import std.format;
4 import std.stdio;
5 import deimos.gmp.gmp;
6 
7 import core.stdc.stdio : FILE;
8 import core.stdc.config : c_long, c_ulong;
9 
10 extern (C) nothrow:
11 
12 /**************** Integer (i.e. Z) routines.  ****************/
13 
14 alias _mpz_realloc = __gmpz_realloc;
15 alias mpz_realloc = __gmpz_realloc;
16 extern (C) void *__gmpz_realloc (mpz_ptr, mp_size_t);
17 
18 alias mpz_abs = __gmpz_abs;
19 extern (C) void __gmpz_abs (mpz_ptr, mpz_srcptr);
20 
21 alias mpz_add = __gmpz_add;
22 extern (C) void __gmpz_add (mpz_ptr, mpz_srcptr, mpz_srcptr);
23 
24 alias mpz_add_ui = __gmpz_add_ui;
25 extern (C) void __gmpz_add_ui (mpz_ptr, mpz_srcptr, c_ulong);
26 
27 alias mpz_addmul = __gmpz_addmul;
28 extern (C) void __gmpz_addmul (mpz_ptr, mpz_srcptr, mpz_srcptr);
29 
30 alias mpz_addmul_ui = __gmpz_addmul_ui;
31 extern (C) void __gmpz_addmul_ui (mpz_ptr, mpz_srcptr, c_ulong);
32 
33 alias mpz_and = __gmpz_and;
34 extern (C) void __gmpz_and (mpz_ptr, mpz_srcptr, mpz_srcptr);
35 
36 alias mpz_bin_ui = __gmpz_bin_ui;
37 extern (C) void __gmpz_bin_ui (mpz_ptr, mpz_srcptr, c_ulong);
38 
39 alias mpz_bin_uiui = __gmpz_bin_uiui;
40 extern (C) void __gmpz_bin_uiui (mpz_ptr, c_ulong, c_ulong);
41 
42 alias mpz_cdiv_q = __gmpz_cdiv_q;
43 extern (C) void __gmpz_cdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
44 
45 alias mpz_cdiv_q_2exp = __gmpz_cdiv_q_2exp;
46 extern (C) void __gmpz_cdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
47 
48 alias mpz_cdiv_q_ui = __gmpz_cdiv_q_ui;
49 extern (C) c_ulong __gmpz_cdiv_q_ui (mpz_ptr, mpz_srcptr, c_ulong);
50 
51 alias mpz_cdiv_qr = __gmpz_cdiv_qr;
52 extern (C) void __gmpz_cdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
53 
54 alias mpz_cdiv_qr_ui = __gmpz_cdiv_qr_ui;
55 extern (C) c_ulong __gmpz_cdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, c_ulong);
56 
57 alias mpz_cdiv_r = __gmpz_cdiv_r;
58 extern (C) void __gmpz_cdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
59 
60 alias mpz_cdiv_r_2exp = __gmpz_cdiv_r_2exp;
61 extern (C) void __gmpz_cdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
62 
63 alias mpz_cdiv_r_ui = __gmpz_cdiv_r_ui;
64 extern (C) c_ulong __gmpz_cdiv_r_ui (mpz_ptr, mpz_srcptr, c_ulong);
65 
66 alias mpz_cdiv_ui = __gmpz_cdiv_ui;
67 extern (C) c_ulong __gmpz_cdiv_ui (mpz_srcptr, c_ulong) pure;
68 
69 alias mpz_clear = __gmpz_clear;
70 extern (C) void __gmpz_clear (mpz_ptr);
71 
72 alias mpz_clears = __gmpz_clears;
73 extern (C) void __gmpz_clears (mpz_ptr, ...);
74 
75 alias mpz_clrbit = __gmpz_clrbit;
76 extern (C) void __gmpz_clrbit (mpz_ptr, mp_bitcnt_t);
77 
78 alias mpz_cmp = __gmpz_cmp;
79 extern (C) int __gmpz_cmp (mpz_srcptr, mpz_srcptr) nothrow pure;
80 
81 alias mpz_cmp_d = __gmpz_cmp_d;
82 extern (C) int __gmpz_cmp_d (mpz_srcptr, double) pure;
83 
84 alias mpz_cmp_si  = __gmpz_cmp_si;
85 extern (C) int __gmpz_cmp_si (mpz_srcptr, c_long) nothrow pure;
86 
87 alias mpz_cmp_ui  = __gmpz_cmp_ui;
88 extern (C) int __gmpz_cmp_ui (mpz_srcptr, c_ulong) nothrow pure;
89 
90 alias mpz_cmpabs = __gmpz_cmpabs;
91 extern (C) int __gmpz_cmpabs (mpz_srcptr, mpz_srcptr) nothrow pure;
92 
93 alias mpz_cmpabs_d = __gmpz_cmpabs_d;
94 extern (C) int __gmpz_cmpabs_d (mpz_srcptr, double) pure;
95 
96 alias mpz_cmpabs_ui = __gmpz_cmpabs_ui;
97 extern (C) int __gmpz_cmpabs_ui (mpz_srcptr, c_ulong) nothrow pure;
98 
99 alias mpz_com = __gmpz_com;
100 extern (C) void __gmpz_com (mpz_ptr, mpz_srcptr);
101 
102 alias mpz_combit = __gmpz_combit;
103 extern (C) void __gmpz_combit (mpz_ptr, mp_bitcnt_t);
104 
105 alias mpz_congruent_p = __gmpz_congruent_p;
106 extern (C) int __gmpz_congruent_p (mpz_srcptr, mpz_srcptr, mpz_srcptr) pure;
107 
108 alias mpz_congruent_2exp_p = __gmpz_congruent_2exp_p;
109 extern (C) int __gmpz_congruent_2exp_p (mpz_srcptr, mpz_srcptr, mp_bitcnt_t) nothrow pure;
110 
111 alias mpz_congruent_ui_p = __gmpz_congruent_ui_p;
112 extern (C) int __gmpz_congruent_ui_p (mpz_srcptr, c_ulong, c_ulong) pure;
113 
114 alias mpz_divexact = __gmpz_divexact;
115 extern (C) void __gmpz_divexact (mpz_ptr, mpz_srcptr, mpz_srcptr);
116 
117 alias mpz_divexact_ui = __gmpz_divexact_ui;
118 extern (C) void __gmpz_divexact_ui (mpz_ptr, mpz_srcptr, c_ulong);
119 
120 alias mpz_divisible_p = __gmpz_divisible_p;
121 extern (C) int __gmpz_divisible_p (mpz_srcptr, mpz_srcptr) pure;
122 
123 alias mpz_divisible_ui_p = __gmpz_divisible_ui_p;
124 extern (C) int __gmpz_divisible_ui_p (mpz_srcptr, c_ulong) pure;
125 
126 alias mpz_divisible_2exp_p = __gmpz_divisible_2exp_p;
127 extern (C) int __gmpz_divisible_2exp_p (mpz_srcptr, mp_bitcnt_t) nothrow pure;
128 
129 alias mpz_dump = __gmpz_dump;
130 extern (C) void __gmpz_dump (mpz_srcptr);
131 
132 alias mpz_export = __gmpz_export;
133 extern (C) void * __gmpz_export (void *, size_t *, int, size_t, int, size_t, mpz_srcptr);
134 
135 alias mpz_fac_ui = __gmpz_fac_ui;
136 extern (C) void __gmpz_fac_ui (mpz_ptr, c_ulong);
137 
138 alias mpz_2fac_ui = __gmpz_2fac_ui;
139 extern (C) void __gmpz_2fac_ui (mpz_ptr, c_ulong);
140 
141 alias mpz_mfac_uiui = __gmpz_mfac_uiui;
142 extern (C) void __gmpz_mfac_uiui (mpz_ptr, c_ulong, c_ulong);
143 
144 alias mpz_primorial_ui = __gmpz_primorial_ui;
145 extern (C) void __gmpz_primorial_ui (mpz_ptr, c_ulong);
146 
147 alias mpz_fdiv_q = __gmpz_fdiv_q;
148 extern (C) void __gmpz_fdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
149 
150 alias mpz_fdiv_q_2exp = __gmpz_fdiv_q_2exp;
151 extern (C) void __gmpz_fdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
152 
153 alias mpz_fdiv_q_ui = __gmpz_fdiv_q_ui;
154 extern (C) c_ulong __gmpz_fdiv_q_ui (mpz_ptr, mpz_srcptr, c_ulong);
155 
156 alias mpz_fdiv_qr = __gmpz_fdiv_qr;
157 extern (C) void __gmpz_fdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
158 
159 alias mpz_fdiv_qr_ui = __gmpz_fdiv_qr_ui;
160 extern (C) c_ulong __gmpz_fdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, c_ulong);
161 
162 alias mpz_fdiv_r = __gmpz_fdiv_r;
163 extern (C) void __gmpz_fdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
164 
165 alias mpz_fdiv_r_2exp = __gmpz_fdiv_r_2exp;
166 extern (C) void __gmpz_fdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
167 
168 alias mpz_fdiv_r_ui = __gmpz_fdiv_r_ui;
169 extern (C) c_ulong __gmpz_fdiv_r_ui (mpz_ptr, mpz_srcptr, c_ulong);
170 
171 alias mpz_fdiv_ui = __gmpz_fdiv_ui;
172 extern (C) c_ulong __gmpz_fdiv_ui (mpz_srcptr, c_ulong) pure;
173 
174 alias mpz_fib_ui = __gmpz_fib_ui;
175 extern (C) void __gmpz_fib_ui (mpz_ptr, c_ulong);
176 
177 alias mpz_fib2_ui = __gmpz_fib2_ui;
178 extern (C) void __gmpz_fib2_ui (mpz_ptr, mpz_ptr, c_ulong);
179 
180 alias mpz_fits_sint_p = __gmpz_fits_sint_p;
181 extern (C) int __gmpz_fits_sint_p (mpz_srcptr) nothrow pure;
182 
183 alias mpz_fits_slong_p = __gmpz_fits_slong_p;
184 extern (C) int __gmpz_fits_slong_p (mpz_srcptr) nothrow pure;
185 
186 alias mpz_fits_sshort_p = __gmpz_fits_sshort_p;
187 extern (C) int __gmpz_fits_sshort_p (mpz_srcptr) nothrow pure;
188 
189 alias mpz_fits_uint_p = __gmpz_fits_uint_p;
190 extern (C) int __gmpz_fits_uint_p (mpz_srcptr) nothrow pure;
191 
192 alias mpz_fits_c_ulong_p = __gmpz_fits_c_ulong_p;
193 extern (C) int __gmpz_fits_c_ulong_p (mpz_srcptr) nothrow pure;
194 
195 alias mpz_fits_ushort_p = __gmpz_fits_ushort_p;
196 extern (C) int __gmpz_fits_ushort_p (mpz_srcptr) nothrow pure;
197 
198 alias mpz_gcd = __gmpz_gcd;
199 extern (C) void __gmpz_gcd (mpz_ptr, mpz_srcptr, mpz_srcptr);
200 
201 alias mpz_gcd_ui = __gmpz_gcd_ui;
202 extern (C) c_ulong __gmpz_gcd_ui (mpz_ptr, mpz_srcptr, c_ulong);
203 
204 alias mpz_gcdext = __gmpz_gcdext;
205 extern (C) void __gmpz_gcdext (mpz_ptr, mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
206 
207 alias mpz_get_d = __gmpz_get_d;
208 extern (C) double __gmpz_get_d (mpz_srcptr) pure;
209 
210 alias mpz_get_d_2exp = __gmpz_get_d_2exp;
211 extern (C) double __gmpz_get_d_2exp (c_long *, mpz_srcptr);
212 
213 alias mpz_get_si = __gmpz_get_si;
214 extern (C) /* signed */ c_long __gmpz_get_si (mpz_srcptr) nothrow pure;
215 
216 alias mpz_get_str = __gmpz_get_str;
217 extern (C) char * __gmpz_get_str (char *, int, mpz_srcptr);
218 
219 alias mpz_get_ui = __gmpz_get_ui;
220 extern (C) c_ulong __gmpz_get_ui (mpz_srcptr) nothrow pure;
221 
222 alias mpz_getlimbn = __gmpz_getlimbn;
223 extern (C) mp_limb_t __gmpz_getlimbn (mpz_srcptr, mp_size_t) nothrow pure;
224 
225 alias mpz_hamdist = __gmpz_hamdist;
226 extern (C) mp_bitcnt_t __gmpz_hamdist (mpz_srcptr, mpz_srcptr) nothrow pure;
227 
228 alias mpz_import = __gmpz_import;
229 extern (C) void __gmpz_import (mpz_ptr, size_t, int, size_t, int, size_t, const void *);
230 
231 alias mpz_init = __gmpz_init;
232 extern (C) void __gmpz_init (mpz_ptr);
233 
234 alias mpz_init2 = __gmpz_init2;
235 extern (C) void __gmpz_init2 (mpz_ptr, mp_bitcnt_t);
236 
237 alias mpz_inits = __gmpz_inits;
238 extern (C) void __gmpz_inits (mpz_ptr, ...);
239 
240 alias mpz_init_set = __gmpz_init_set;
241 extern (C) void __gmpz_init_set (mpz_ptr, mpz_srcptr);
242 
243 alias mpz_init_set_d = __gmpz_init_set_d;
244 extern (C) void __gmpz_init_set_d (mpz_ptr, double);
245 
246 alias mpz_init_set_si = __gmpz_init_set_si;
247 extern (C) void __gmpz_init_set_si (mpz_ptr, c_long);
248 
249 alias mpz_init_set_str = __gmpz_init_set_str;
250 extern (C) int __gmpz_init_set_str (mpz_ptr, const char *, int);
251 
252 alias mpz_init_set_ui = __gmpz_init_set_ui;
253 extern (C) void __gmpz_init_set_ui (mpz_ptr, c_ulong);
254 
255 alias mpz_inp_raw = __gmpz_inp_raw;
256 extern (C) size_t __gmpz_inp_raw (mpz_ptr, FILE *);
257 
258 alias mpz_inp_str = __gmpz_inp_str;
259 extern (C) size_t __gmpz_inp_str (mpz_ptr, FILE *, int);
260 
261 alias mpz_invert = __gmpz_invert;
262 extern (C) int __gmpz_invert (mpz_ptr, mpz_srcptr, mpz_srcptr);
263 
264 alias mpz_ior = __gmpz_ior;
265 extern (C) void __gmpz_ior (mpz_ptr, mpz_srcptr, mpz_srcptr);
266 
267 alias mpz_jacobi = __gmpz_jacobi;
268 extern (C) int __gmpz_jacobi (mpz_srcptr, mpz_srcptr) pure;
269 
270 alias mpz_kronecker = mpz_jacobi  /* alias */;
271 
272 alias mpz_kronecker_si = __gmpz_kronecker_si;
273 extern (C) int __gmpz_kronecker_si (mpz_srcptr, c_long) pure;
274 
275 alias mpz_kronecker_ui = __gmpz_kronecker_ui;
276 extern (C) int __gmpz_kronecker_ui (mpz_srcptr, c_ulong) pure;
277 
278 alias mpz_si_kronecker = __gmpz_si_kronecker;
279 extern (C) int __gmpz_si_kronecker (c_long, mpz_srcptr) pure;
280 
281 alias mpz_ui_kronecker = __gmpz_ui_kronecker;
282 extern (C) int __gmpz_ui_kronecker (c_ulong, mpz_srcptr) pure;
283 
284 alias mpz_lcm = __gmpz_lcm;
285 extern (C) void __gmpz_lcm (mpz_ptr, mpz_srcptr, mpz_srcptr);
286 
287 alias mpz_lcm_ui = __gmpz_lcm_ui;
288 extern (C) void __gmpz_lcm_ui (mpz_ptr, mpz_srcptr, c_ulong);
289 
290 alias mpz_legendre = mpz_jacobi  /* alias */;
291 
292 alias mpz_lucnum_ui = __gmpz_lucnum_ui;
293 extern (C) void __gmpz_lucnum_ui (mpz_ptr, c_ulong);
294 
295 alias mpz_lucnum2_ui = __gmpz_lucnum2_ui;
296 extern (C) void __gmpz_lucnum2_ui (mpz_ptr, mpz_ptr, c_ulong);
297 
298 alias mpz_millerrabin = __gmpz_millerrabin;
299 extern (C) int __gmpz_millerrabin (mpz_srcptr, int) pure;
300 
301 alias mpz_mod = __gmpz_mod;
302 extern (C) void __gmpz_mod (mpz_ptr, mpz_srcptr, mpz_srcptr);
303 
304 alias mpz_mod_ui = mpz_fdiv_r_ui /* same as fdiv_r because divisor unsigned */;
305 
306 alias mpz_mul = __gmpz_mul;
307 extern (C) void __gmpz_mul (mpz_ptr, mpz_srcptr, mpz_srcptr);
308 
309 alias mpz_mul_2exp = __gmpz_mul_2exp;
310 extern (C) void __gmpz_mul_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
311 
312 alias mpz_mul_si = __gmpz_mul_si;
313 extern (C) void __gmpz_mul_si (mpz_ptr, mpz_srcptr, c_long);
314 
315 alias mpz_mul_ui = __gmpz_mul_ui;
316 extern (C) void __gmpz_mul_ui (mpz_ptr, mpz_srcptr, c_ulong);
317 
318 alias mpz_neg = __gmpz_neg;
319 extern (C) void __gmpz_neg (mpz_ptr, mpz_srcptr);
320 
321 alias mpz_nextprime = __gmpz_nextprime;
322 extern (C) void __gmpz_nextprime (mpz_ptr, mpz_srcptr);
323 
324 alias mpz_out_raw = __gmpz_out_raw;
325 extern (C) size_t __gmpz_out_raw (FILE *, mpz_srcptr);
326 
327 alias mpz_out_str = __gmpz_out_str;
328 extern (C) size_t __gmpz_out_str (FILE *, int, mpz_srcptr);
329 
330 alias mpz_perfect_power_p = __gmpz_perfect_power_p;
331 extern (C) int __gmpz_perfect_power_p (mpz_srcptr) pure;
332 
333 alias mpz_popcount = __gmpz_popcount;
334 extern (C) mp_bitcnt_t __gmpz_popcount (mpz_srcptr) nothrow pure;
335 
336 alias mpz_pow_ui = __gmpz_pow_ui;
337 extern (C) void __gmpz_pow_ui (mpz_ptr, mpz_srcptr, c_ulong);
338 
339 alias mpz_powm = __gmpz_powm;
340 extern (C) void __gmpz_powm (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr);
341 
342 alias mpz_powm_sec = __gmpz_powm_sec;
343 extern (C) void __gmpz_powm_sec (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr);
344 
345 alias mpz_powm_ui = __gmpz_powm_ui;
346 extern (C) void __gmpz_powm_ui (mpz_ptr, mpz_srcptr, c_ulong, mpz_srcptr);
347 
348 alias mpz_probab_prime_p = __gmpz_probab_prime_p;
349 extern (C) int __gmpz_probab_prime_p (mpz_srcptr, int) pure;
350 
351 alias mpz_random = __gmpz_random;
352 extern (C) void __gmpz_random (mpz_ptr, mp_size_t);
353 
354 alias mpz_random2 = __gmpz_random2;
355 extern (C) void __gmpz_random2 (mpz_ptr, mp_size_t);
356 
357 alias mpz_realloc2 = __gmpz_realloc2;
358 extern (C) void __gmpz_realloc2 (mpz_ptr, mp_bitcnt_t);
359 
360 alias mpz_remove = __gmpz_remove;
361 extern (C) mp_bitcnt_t __gmpz_remove (mpz_ptr, mpz_srcptr, mpz_srcptr);
362 
363 alias mpz_root = __gmpz_root;
364 extern (C) int __gmpz_root (mpz_ptr, mpz_srcptr, c_ulong);
365 
366 alias mpz_rootrem = __gmpz_rootrem;
367 extern (C) void __gmpz_rootrem (mpz_ptr, mpz_ptr, mpz_srcptr, c_ulong);
368 
369 alias mpz_rrandomb = __gmpz_rrandomb;
370 extern (C) void __gmpz_rrandomb (mpz_ptr, gmp_randstate_t, mp_bitcnt_t);
371 
372 alias mpz_scan0 = __gmpz_scan0;
373 extern (C) mp_bitcnt_t __gmpz_scan0 (mpz_srcptr, mp_bitcnt_t) nothrow pure;
374 
375 alias mpz_scan1 = __gmpz_scan1;
376 extern (C) mp_bitcnt_t __gmpz_scan1 (mpz_srcptr, mp_bitcnt_t) nothrow pure;
377 
378 alias mpz_set = __gmpz_set;
379 extern (C) void __gmpz_set (mpz_ptr, mpz_srcptr);
380 
381 alias mpz_set_d = __gmpz_set_d;
382 extern (C) void __gmpz_set_d (mpz_ptr, double);
383 
384 alias mpz_set_f = __gmpz_set_f;
385 extern (C) void __gmpz_set_f (mpz_ptr, mpf_srcptr);
386 
387 alias mpz_set_q = __gmpz_set_q;
388 extern (C) void __gmpz_set_q (mpz_ptr, mpq_srcptr);
389 
390 alias mpz_set_si = __gmpz_set_si;
391 extern (C) void __gmpz_set_si (mpz_ptr, c_long);
392 
393 alias mpz_set_str = __gmpz_set_str;
394 extern (C) int __gmpz_set_str (mpz_ptr, const char *, int);
395 
396 alias mpz_set_ui = __gmpz_set_ui;
397 extern (C) void __gmpz_set_ui (mpz_ptr, c_ulong);
398 
399 alias mpz_setbit = __gmpz_setbit;
400 extern (C) void __gmpz_setbit (mpz_ptr, mp_bitcnt_t);
401 
402 alias mpz_size = __gmpz_size;
403 extern (C) size_t __gmpz_size (mpz_srcptr) nothrow pure;
404 
405 alias mpz_sizeinbase = __gmpz_sizeinbase;
406 extern (C) size_t __gmpz_sizeinbase (mpz_srcptr, int) nothrow pure;
407 
408 alias mpz_sqrt = __gmpz_sqrt;
409 extern (C) void __gmpz_sqrt (mpz_ptr, mpz_srcptr);
410 
411 alias mpz_sqrtrem = __gmpz_sqrtrem;
412 extern (C) void __gmpz_sqrtrem (mpz_ptr, mpz_ptr, mpz_srcptr);
413 
414 alias mpz_sub = __gmpz_sub;
415 extern (C) void __gmpz_sub (mpz_ptr, mpz_srcptr, mpz_srcptr);
416 
417 alias mpz_sub_ui = __gmpz_sub_ui;
418 extern (C) void __gmpz_sub_ui (mpz_ptr, mpz_srcptr, c_ulong);
419 
420 alias mpz_ui_sub = __gmpz_ui_sub;
421 extern (C) void __gmpz_ui_sub (mpz_ptr, c_ulong, mpz_srcptr);
422 
423 alias mpz_submul = __gmpz_submul;
424 extern (C) void __gmpz_submul (mpz_ptr, mpz_srcptr, mpz_srcptr);
425 
426 alias mpz_submul_ui = __gmpz_submul_ui;
427 extern (C) void __gmpz_submul_ui (mpz_ptr, mpz_srcptr, c_ulong);
428 
429 alias mpz_swap = __gmpz_swap;
430 extern (C) void __gmpz_swap (mpz_ptr, mpz_ptr) nothrow;
431 
432 alias mpz_tdiv_ui = __gmpz_tdiv_ui;
433 extern (C) c_ulong __gmpz_tdiv_ui (mpz_srcptr, c_ulong) pure;
434 
435 alias mpz_tdiv_q = __gmpz_tdiv_q;
436 extern (C) void __gmpz_tdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
437 
438 alias mpz_tdiv_q_2exp = __gmpz_tdiv_q_2exp;
439 extern (C) void __gmpz_tdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
440 
441 alias mpz_tdiv_q_ui = __gmpz_tdiv_q_ui;
442 extern (C) c_ulong __gmpz_tdiv_q_ui (mpz_ptr, mpz_srcptr, c_ulong);
443 
444 alias mpz_tdiv_qr = __gmpz_tdiv_qr;
445 extern (C) void __gmpz_tdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
446 
447 alias mpz_tdiv_qr_ui = __gmpz_tdiv_qr_ui;
448 extern (C) c_ulong __gmpz_tdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, c_ulong);
449 
450 alias mpz_tdiv_r = __gmpz_tdiv_r;
451 extern (C) void __gmpz_tdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
452 
453 alias mpz_tdiv_r_2exp = __gmpz_tdiv_r_2exp;
454 extern (C) void __gmpz_tdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
455 
456 alias mpz_tdiv_r_ui = __gmpz_tdiv_r_ui;
457 extern (C) c_ulong __gmpz_tdiv_r_ui (mpz_ptr, mpz_srcptr, c_ulong);
458 
459 alias mpz_tstbit = __gmpz_tstbit;
460 extern (C) int __gmpz_tstbit (mpz_srcptr, mp_bitcnt_t) nothrow pure;
461 
462 alias mpz_ui_pow_ui = __gmpz_ui_pow_ui;
463 extern (C) void __gmpz_ui_pow_ui (mpz_ptr, c_ulong, c_ulong);
464 
465 alias mpz_urandomb = __gmpz_urandomb;
466 extern (C) void __gmpz_urandomb (mpz_ptr, gmp_randstate_t, mp_bitcnt_t);
467 
468 alias mpz_urandomm = __gmpz_urandomm;
469 extern (C) void __gmpz_urandomm (mpz_ptr, gmp_randstate_t, mpz_srcptr);
470 
471 alias mpz_xor = __gmpz_xor;
472 alias mpz_eor = __gmpz_xor;
473 extern (C) void __gmpz_xor (mpz_ptr, mpz_srcptr, mpz_srcptr);
474 
475 alias mpz_limbs_read = __gmpz_limbs_read;
476 extern (C) mp_srcptr __gmpz_limbs_read (mpz_srcptr);
477 
478 alias mpz_limbs_write = __gmpz_limbs_write;
479 extern (C) mp_ptr __gmpz_limbs_write (mpz_ptr, mp_size_t);
480 
481 alias mpz_limbs_modify = __gmpz_limbs_modify;
482 extern (C) mp_ptr __gmpz_limbs_modify (mpz_ptr, mp_size_t);
483 
484 alias mpz_limbs_finish = __gmpz_limbs_finish;
485 extern (C) void __gmpz_limbs_finish (mpz_ptr, mp_size_t);
486 
487 alias mpz_roinit_n = __gmpz_roinit_n;
488 extern (C) mpz_srcptr __gmpz_roinit_n (mpz_ptr, mp_srcptr, mp_size_t);