forked from FedeOmoto/nim-gmp
-
Notifications
You must be signed in to change notification settings - Fork 2
/
pure.nim
1517 lines (1503 loc) · 84.1 KB
/
pure.nim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# Nim GMP wrapper
# (c) Copyright 2014 Will Szumski
#
# See the file "COPYING", included in this
# distribution, for details about the copyright.
#
{.deadCodeElim: on.}
when defined(windows):
const libgmp* = "libgmp.dll"
elif defined(macosx):
const libgmp* = "libgmp.dylib"
else:
const libgmp* = "libgmp.so"
type
mm_gmp_randstate_algdata* {.pure.} = object {.union.}
mp_lc*: pointer
mp_limb_t* = uint
mp_limb_signed_t* = int
mp_bitcnt_t* = culong
mm_mpz_struct* {.byref, pure.} = object
mp_alloc*: cint
mp_size*: cint
mp_d*: ptr mp_limb_t
MP_INT* = mm_mpz_struct
mpz_t* = mm_mpz_struct
mp_ptr* = ptr mp_limb_t
mp_srcptr* = ptr mp_limb_t
mp_size_t* = clong
mp_exp_t* = clong
mm_mpq_struct* {.byref, pure.} = object
mp_num*: mm_mpz_struct
mp_den*: mm_mpz_struct
MP_RAT* = mm_mpq_struct
mpq_t* = mm_mpq_struct
mm_mpf_struct* {.byref, pure.} = object
mp_prec*: cint
mp_size*: cint
mp_exp*: mp_exp_t
mp_d*: ptr mp_limb_t
mpf_t* = mm_mpf_struct
gmp_randalg_t* = distinct cint
mm_gmp_randstate_struct* {.pure.} = object
mp_seed*: mpz_t
mp_alg*: gmp_randalg_t
mp_algdata*: mm_gmp_randstate_algdata
gmp_randstate_t* = mm_gmp_randstate_struct
mpz_srcptr* = ptr mm_mpz_struct
mpz_ptr* = ptr mm_mpz_struct
mpf_srcptr* = ptr mm_mpf_struct
mpf_ptr* = ptr mm_mpf_struct
mpq_srcptr* = ptr mm_mpq_struct
mpq_ptr* = ptr mm_mpq_struct
include extratypes
const
GMP_RAND_ALG_DEFAULT: gmp_randalg_t = 0.gmp_randalg_t
GMP_RAND_ALG_LC: gmp_randalg_t = GMP_RAND_ALG_DEFAULT
proc mpq_numref*(a2: mpq_ptr): mpz_ptr = a2.mp_num.addr
proc mpq_numref*(a2: var mpq_t): mpz_ptr = mpq_numref(a2.addr)
proc mpq_denref*(a2: mpq_ptr): mpz_ptr = a2.mp_den.addr
proc mpq_denref*(a2: var mpq_t): mpz_ptr = mpq_denref(a2.addr)
proc mp_set_memory_functions*(a2: proc (a2: csize): pointer; a3: proc (
a2: pointer; a3: csize; a4: csize): pointer;
a4: proc (a2: pointer; a3: csize)) {.
importc: "__gmp_set_memory_functions", dynlib: libgmp, cdecl.}
proc mp_get_memory_functions*(a2: proc (a2: csize): pointer; a3: proc (
a2: pointer; a3: csize; a4: csize): pointer;
a4: proc (a2: pointer; a3: csize)) {.
importc: "__gmp_get_memory_functions", dynlib: libgmp, cdecl.}
var mp_bits_per_limb* {.importc: "mp_bits_per_limb", header: "<gmp.h>".}: cint
var gmp_errno* {.importc: "gmp_errno", header: "<gmp.h>".}: cint
var gmp_version* {.importc: "gmp_version", header: "<gmp.h>".}: cstring
proc gmp_randinit*(a2: gmp_randstate_t; a3: gmp_randalg_t) {.varargs,
importc: "__gmp_randinit", dynlib: libgmp, cdecl.}
proc gmp_randinit_default*(a2: gmp_randstate_t) {.
importc: "__gmp_randinit_default", dynlib: libgmp, cdecl.}
proc gmp_randinit_lc_2exp*(a2: gmp_randstate_t; a3: mpz_srcptr; a4: culong;
a5: mp_bitcnt_t) {.importc: "__gmp_randinit_lc_2exp",
dynlib: libgmp, cdecl.}
proc gmp_randinit_lc_2exp*(a2: gmp_randstate_t; a3: mpz_t; a4: culong;
a5: mp_bitcnt_t) {.importc: "__gmp_randinit_lc_2exp",
dynlib: libgmp, cdecl.}
proc gmp_randinit_lc_2exp_size*(a2: gmp_randstate_t; a3: mp_bitcnt_t): cint {.
importc: "__gmp_randinit_lc_2exp_size", dynlib: libgmp, cdecl.}
proc gmp_randinit_mt*(a2: gmp_randstate_t) {.importc: "__gmp_randinit_mt",
dynlib: libgmp, cdecl.}
proc gmp_randinit_set*(a2: gmp_randstate_t; a3: ptr mm_gmp_randstate_struct) {.
importc: "__gmp_randinit_set", dynlib: libgmp, cdecl.}
proc gmp_randseed*(a2: gmp_randstate_t; a3: mpz_srcptr) {.
importc: "__gmp_randseed", dynlib: libgmp, cdecl.}
proc gmp_randseed*(a2: gmp_randstate_t; a3: mpz_t) {.importc: "__gmp_randseed",
dynlib: libgmp, cdecl.}
proc gmp_randseed_ui*(a2: gmp_randstate_t; a3: culong) {.
importc: "__gmp_randseed_ui", dynlib: libgmp, cdecl.}
proc gmp_randclear*(a2: gmp_randstate_t) {.importc: "__gmp_randclear",
dynlib: libgmp, cdecl.}
proc gmp_urandomb_ui*(a2: gmp_randstate_t; a3: culong): culong {.
importc: "__gmp_urandomb_ui", dynlib: libgmp, cdecl.}
proc gmp_urandomm_ui*(a2: gmp_randstate_t; a3: culong): culong {.
importc: "__gmp_urandomm_ui", dynlib: libgmp, cdecl.}
proc gmp_asprintf*(a2: cstringArray; a3: cstring): cint {.varargs,
importc: "__gmp_asprintf", dynlib: libgmp, cdecl.}
proc gmp_fprintf*(a2: File; a3: cstring): cint {.varargs,
importc: "__gmp_fprintf", dynlib: libgmp, cdecl.}
proc gmp_printf*(a2: cstring): cint {.varargs, importc: "__gmp_printf",
dynlib: libgmp, cdecl.}
proc gmp_snprintf*(a2: cstring; a3: csize; a4: cstring): cint {.varargs,
importc: "__gmp_snprintf", dynlib: libgmp, cdecl.}
proc gmp_sprintf*(a2: cstring; a3: cstring): cint {.varargs,
importc: "__gmp_sprintf", dynlib: libgmp, cdecl.}
proc gmp_fscanf*(a2: File; a3: cstring): cint {.varargs,
importc: "__gmp_fscanf", dynlib: libgmp, cdecl.}
proc gmp_scanf*(a2: cstring): cint {.varargs, importc: "__gmp_scanf",
dynlib: libgmp, cdecl.}
proc gmp_sscanf*(a2: cstring; a3: cstring): cint {.varargs,
importc: "__gmp_sscanf", dynlib: libgmp, cdecl.}
proc mpz_realloc*(a2: mpz_ptr; a3: mp_size_t): pointer {.
importc: "__gmpz_realloc", dynlib: libgmp, cdecl.}
proc mpz_realloc*(a2: var mpz_t; a3: mp_size_t): pointer {.
importc: "__gmpz_realloc", dynlib: libgmp, cdecl.}
proc mpz_add*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_add", dynlib: libgmp, cdecl.}
proc mpz_add*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.importc: "__gmpz_add",
dynlib: libgmp, cdecl.}
proc mpz_add_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong) {.
importc: "__gmpz_add_ui", dynlib: libgmp, cdecl.}
proc mpz_add_ui*(a2: var mpz_t; a3: mpz_t; a4: culong) {.
importc: "__gmpz_add_ui", dynlib: libgmp, cdecl.}
proc mpz_addmul*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_addmul", dynlib: libgmp, cdecl.}
proc mpz_addmul*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.
importc: "__gmpz_addmul", dynlib: libgmp, cdecl.}
proc mpz_addmul_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong) {.
importc: "__gmpz_addmul_ui", dynlib: libgmp, cdecl.}
proc mpz_addmul_ui*(a2: var mpz_t; a3: mpz_t; a4: culong) {.
importc: "__gmpz_addmul_ui", dynlib: libgmp, cdecl.}
proc mpz_and*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_and", dynlib: libgmp, cdecl.}
proc mpz_and*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.importc: "__gmpz_and",
dynlib: libgmp, cdecl.}
proc mpz_array_init*(a2: mpz_ptr; a3: mp_size_t; a4: mp_size_t) {.
importc: "__gmpz_array_init", dynlib: libgmp, cdecl.}
proc mpz_array_init*(a2: var mpz_t; a3: mp_size_t; a4: mp_size_t) {.
importc: "__gmpz_array_init", dynlib: libgmp, cdecl.}
proc mpz_bin_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong) {.
importc: "__gmpz_bin_ui", dynlib: libgmp, cdecl.}
proc mpz_bin_ui*(a2: var mpz_t; a3: mpz_t; a4: culong) {.
importc: "__gmpz_bin_ui", dynlib: libgmp, cdecl.}
proc mpz_bin_uiui*(a2: mpz_ptr; a3: culong; a4: culong) {.
importc: "__gmpz_bin_uiui", dynlib: libgmp, cdecl.}
proc mpz_bin_uiui*(a2: var mpz_t; a3: culong; a4: culong) {.
importc: "__gmpz_bin_uiui", dynlib: libgmp, cdecl.}
proc mpz_cdiv_q*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_cdiv_q", dynlib: libgmp, cdecl.}
proc mpz_cdiv_q*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.
importc: "__gmpz_cdiv_q", dynlib: libgmp, cdecl.}
proc mpz_cdiv_q_2exp*(a2: mpz_ptr; a3: mpz_srcptr; a4: mp_bitcnt_t) {.
importc: "__gmpz_cdiv_q_2exp", dynlib: libgmp, cdecl.}
proc mpz_cdiv_q_2exp*(a2: var mpz_t; a3: mpz_t; a4: mp_bitcnt_t) {.
importc: "__gmpz_cdiv_q_2exp", dynlib: libgmp, cdecl.}
proc mpz_cdiv_q_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong): culong {.
importc: "__gmpz_cdiv_q_ui", dynlib: libgmp, cdecl.}
proc mpz_cdiv_q_ui*(a2: var mpz_t; a3: mpz_t; a4: culong): culong {.
importc: "__gmpz_cdiv_q_ui", dynlib: libgmp, cdecl.}
proc mpz_cdiv_qr*(a2: mpz_ptr; a3: mpz_ptr; a4: mpz_srcptr; a5: mpz_srcptr) {.
importc: "__gmpz_cdiv_qr", dynlib: libgmp, cdecl.}
proc mpz_cdiv_qr*(a2: var mpz_t; a3: var mpz_t; a4: mpz_t; a5: mpz_t) {.
importc: "__gmpz_cdiv_qr", dynlib: libgmp, cdecl.}
proc mpz_cdiv_qr_ui*(a2: mpz_ptr; a3: mpz_ptr; a4: mpz_srcptr; a5: culong): culong {.
importc: "__gmpz_cdiv_qr_ui", dynlib: libgmp, cdecl.}
proc mpz_cdiv_qr_ui*(a2: var mpz_t; a3: var mpz_t; a4: mpz_t; a5: culong): culong {.
importc: "__gmpz_cdiv_qr_ui", dynlib: libgmp, cdecl.}
proc mpz_cdiv_r*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_cdiv_r", dynlib: libgmp, cdecl.}
proc mpz_cdiv_r*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.
importc: "__gmpz_cdiv_r", dynlib: libgmp, cdecl.}
proc mpz_cdiv_r_2exp*(a2: mpz_ptr; a3: mpz_srcptr; a4: mp_bitcnt_t) {.
importc: "__gmpz_cdiv_r_2exp", dynlib: libgmp, cdecl.}
proc mpz_cdiv_r_2exp*(a2: var mpz_t; a3: mpz_t; a4: mp_bitcnt_t) {.
importc: "__gmpz_cdiv_r_2exp", dynlib: libgmp, cdecl.}
proc mpz_cdiv_r_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong): culong {.
importc: "__gmpz_cdiv_r_ui", dynlib: libgmp, cdecl.}
proc mpz_cdiv_r_ui*(a2: var mpz_t; a3: mpz_t; a4: culong): culong {.
importc: "__gmpz_cdiv_r_ui", dynlib: libgmp, cdecl.}
proc mpz_cdiv_ui*(a2: mpz_srcptr; a3: culong): culong {.
importc: "__gmpz_cdiv_ui", dynlib: libgmp, cdecl.}
proc mpz_cdiv_ui*(a2: mpz_t; a3: culong): culong {.importc: "__gmpz_cdiv_ui",
dynlib: libgmp, cdecl.}
proc mpz_clear*(a2: mpz_ptr) {.importc: "__gmpz_clear", dynlib: libgmp, cdecl.}
proc mpz_clear*(a2: var mpz_t) {.importc: "__gmpz_clear", dynlib: libgmp, cdecl.}
proc mpz_clears*(a2: mpz_ptr) {.varargs, importc: "__gmpz_clears",
dynlib: libgmp, cdecl.}
proc mpz_clears*(a2: var mpz_t) {.varargs, importc: "__gmpz_clears",
dynlib: libgmp, cdecl.}
proc mpz_clrbit*(a2: mpz_ptr; a3: mp_bitcnt_t) {.importc: "__gmpz_clrbit",
dynlib: libgmp, cdecl.}
proc mpz_clrbit*(a2: var mpz_t; a3: mp_bitcnt_t) {.importc: "__gmpz_clrbit",
dynlib: libgmp, cdecl.}
proc mpz_cmp*(a2: mpz_srcptr; a3: mpz_srcptr): cint {.importc: "__gmpz_cmp",
dynlib: libgmp, cdecl.}
proc mpz_cmp*(a2: mpz_t; a3: mpz_t): cint {.importc: "__gmpz_cmp",
dynlib: libgmp, cdecl.}
proc mpz_cmp_d*(a2: mpz_srcptr; a3: cdouble): cint {.importc: "__gmpz_cmp_d",
dynlib: libgmp, cdecl.}
proc mpz_cmp_d*(a2: mpz_t; a3: cdouble): cint {.importc: "__gmpz_cmp_d",
dynlib: libgmp, cdecl.}
proc mpz_cmp_si*(a2: mpz_srcptr; a3: clong): cint {.importc: "__gmpz_cmp_si",
dynlib: libgmp, cdecl.}
proc mpz_cmp_si*(a2: mpz_t; a3: clong): cint {.importc: "__gmpz_cmp_si",
dynlib: libgmp, cdecl.}
proc mpz_cmp_ui*(a2: mpz_srcptr; a3: culong): cint {.importc: "__gmpz_cmp_ui",
dynlib: libgmp, cdecl.}
proc mpz_cmp_ui*(a2: mpz_t; a3: culong): cint {.importc: "__gmpz_cmp_ui",
dynlib: libgmp, cdecl.}
proc mpz_cmpabs*(a2: mpz_srcptr; a3: mpz_srcptr): cint {.
importc: "__gmpz_cmpabs", dynlib: libgmp, cdecl.}
proc mpz_cmpabs*(a2: mpz_t; a3: mpz_t): cint {.importc: "__gmpz_cmpabs",
dynlib: libgmp, cdecl.}
proc mpz_cmpabs_d*(a2: mpz_srcptr; a3: cdouble): cint {.
importc: "__gmpz_cmpabs_d", dynlib: libgmp, cdecl.}
proc mpz_cmpabs_d*(a2: mpz_t; a3: cdouble): cint {.importc: "__gmpz_cmpabs_d",
dynlib: libgmp, cdecl.}
proc mpz_cmpabs_ui*(a2: mpz_srcptr; a3: culong): cint {.
importc: "__gmpz_cmpabs_ui", dynlib: libgmp, cdecl.}
proc mpz_cmpabs_ui*(a2: mpz_t; a3: culong): cint {.importc: "__gmpz_cmpabs_ui",
dynlib: libgmp, cdecl.}
proc mpz_com*(a2: mpz_ptr; a3: mpz_srcptr) {.importc: "__gmpz_com",
dynlib: libgmp, cdecl.}
proc mpz_com*(a2: var mpz_t; a3: mpz_t) {.importc: "__gmpz_com", dynlib: libgmp,
cdecl.}
proc mpz_combit*(a2: mpz_ptr; a3: mp_bitcnt_t) {.importc: "__gmpz_combit",
dynlib: libgmp, cdecl.}
proc mpz_combit*(a2: var mpz_t; a3: mp_bitcnt_t) {.importc: "__gmpz_combit",
dynlib: libgmp, cdecl.}
proc mpz_congruent_p*(a2: mpz_srcptr; a3: mpz_srcptr; a4: mpz_srcptr): cint {.
importc: "__gmpz_congruent_p", dynlib: libgmp, cdecl.}
proc mpz_congruent_p*(a2: mpz_t; a3: mpz_t; a4: mpz_t): cint {.
importc: "__gmpz_congruent_p", dynlib: libgmp, cdecl.}
proc mpz_congruent_2exp_p*(a2: mpz_srcptr; a3: mpz_srcptr; a4: mp_bitcnt_t): cint {.
importc: "__gmpz_congruent_2exp_p", dynlib: libgmp, cdecl.}
proc mpz_congruent_2exp_p*(a2: mpz_t; a3: mpz_t; a4: mp_bitcnt_t): cint {.
importc: "__gmpz_congruent_2exp_p", dynlib: libgmp, cdecl.}
proc mpz_congruent_ui_p*(a2: mpz_srcptr; a3: culong; a4: culong): cint {.
importc: "__gmpz_congruent_ui_p", dynlib: libgmp, cdecl.}
proc mpz_congruent_ui_p*(a2: mpz_t; a3: culong; a4: culong): cint {.
importc: "__gmpz_congruent_ui_p", dynlib: libgmp, cdecl.}
proc mpz_divexact*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_divexact", dynlib: libgmp, cdecl.}
proc mpz_divexact*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.
importc: "__gmpz_divexact", dynlib: libgmp, cdecl.}
proc mpz_divexact_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong) {.
importc: "__gmpz_divexact_ui", dynlib: libgmp, cdecl.}
proc mpz_divexact_ui*(a2: var mpz_t; a3: mpz_t; a4: culong) {.
importc: "__gmpz_divexact_ui", dynlib: libgmp, cdecl.}
proc mpz_divisible_p*(a2: mpz_srcptr; a3: mpz_srcptr): cint {.
importc: "__gmpz_divisible_p", dynlib: libgmp, cdecl.}
proc mpz_divisible_p*(a2: mpz_t; a3: mpz_t): cint {.
importc: "__gmpz_divisible_p", dynlib: libgmp, cdecl.}
proc mpz_divisible_ui_p*(a2: mpz_srcptr; a3: culong): cint {.
importc: "__gmpz_divisible_ui_p", dynlib: libgmp, cdecl.}
proc mpz_divisible_ui_p*(a2: mpz_t; a3: culong): cint {.
importc: "__gmpz_divisible_ui_p", dynlib: libgmp, cdecl.}
proc mpz_divisible_2exp_p*(a2: mpz_srcptr; a3: mp_bitcnt_t): cint {.
importc: "__gmpz_divisible_2exp_p", dynlib: libgmp, cdecl.}
proc mpz_divisible_2exp_p*(a2: mpz_t; a3: mp_bitcnt_t): cint {.
importc: "__gmpz_divisible_2exp_p", dynlib: libgmp, cdecl.}
proc mpz_dump*(a2: mpz_srcptr) {.importc: "__gmpz_dump", dynlib: libgmp, cdecl.}
proc mpz_dump*(a2: mpz_t) {.importc: "__gmpz_dump", dynlib: libgmp, cdecl.}
proc mpz_export*(a2: pointer; a3: ptr csize; a4: cint; a5: csize; a6: cint;
a7: csize; a8: mpz_srcptr): pointer {.importc: "__gmpz_export",
dynlib: libgmp, cdecl.}
proc mpz_export*(a2: pointer; a3: ptr csize; a4: cint; a5: csize; a6: cint;
a7: csize; a8: mpz_t): pointer {.importc: "__gmpz_export",
dynlib: libgmp, cdecl.}
proc mpz_fac_ui*(a2: mpz_ptr; a3: culong) {.importc: "__gmpz_fac_ui",
dynlib: libgmp, cdecl.}
proc mpz_fac_ui*(a2: var mpz_t; a3: culong) {.importc: "__gmpz_fac_ui",
dynlib: libgmp, cdecl.}
proc mpz_2fac_ui*(a2: mpz_ptr; a3: culong) {.importc: "__gmpz_2fac_ui",
dynlib: libgmp, cdecl.}
proc mpz_2fac_ui*(a2: var mpz_t; a3: culong) {.importc: "__gmpz_2fac_ui",
dynlib: libgmp, cdecl.}
proc mpz_mfac_uiui*(a2: mpz_ptr; a3: culong; a4: culong) {.
importc: "__gmpz_mfac_uiui", dynlib: libgmp, cdecl.}
proc mpz_mfac_uiui*(a2: var mpz_t; a3: culong; a4: culong) {.
importc: "__gmpz_mfac_uiui", dynlib: libgmp, cdecl.}
proc mpz_primorial_ui*(a2: mpz_ptr; a3: culong) {.
importc: "__gmpz_primorial_ui", dynlib: libgmp, cdecl.}
proc mpz_primorial_ui*(a2: var mpz_t; a3: culong) {.
importc: "__gmpz_primorial_ui", dynlib: libgmp, cdecl.}
proc mpz_fdiv_q*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_fdiv_q", dynlib: libgmp, cdecl.}
proc mpz_fdiv_q*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.
importc: "__gmpz_fdiv_q", dynlib: libgmp, cdecl.}
proc mpz_fdiv_q_2exp*(a2: mpz_ptr; a3: mpz_srcptr; a4: mp_bitcnt_t) {.
importc: "__gmpz_fdiv_q_2exp", dynlib: libgmp, cdecl.}
proc mpz_fdiv_q_2exp*(a2: var mpz_t; a3: mpz_t; a4: mp_bitcnt_t) {.
importc: "__gmpz_fdiv_q_2exp", dynlib: libgmp, cdecl.}
proc mpz_fdiv_q_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong): culong {.
importc: "__gmpz_fdiv_q_ui", dynlib: libgmp, cdecl.}
proc mpz_fdiv_q_ui*(a2: var mpz_t; a3: mpz_t; a4: culong): culong {.
importc: "__gmpz_fdiv_q_ui", dynlib: libgmp, cdecl.}
proc mpz_fdiv_qr*(a2: mpz_ptr; a3: mpz_ptr; a4: mpz_srcptr; a5: mpz_srcptr) {.
importc: "__gmpz_fdiv_qr", dynlib: libgmp, cdecl.}
proc mpz_fdiv_qr*(a2: var mpz_t; a3: var mpz_t; a4: mpz_t; a5: mpz_t) {.
importc: "__gmpz_fdiv_qr", dynlib: libgmp, cdecl.}
proc mpz_fdiv_qr_ui*(a2: mpz_ptr; a3: mpz_ptr; a4: mpz_srcptr; a5: culong): culong {.
importc: "__gmpz_fdiv_qr_ui", dynlib: libgmp, cdecl.}
proc mpz_fdiv_qr_ui*(a2: var mpz_t; a3: var mpz_t; a4: mpz_t; a5: culong): culong {.
importc: "__gmpz_fdiv_qr_ui", dynlib: libgmp, cdecl.}
proc mpz_fdiv_r*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_fdiv_r", dynlib: libgmp, cdecl.}
proc mpz_fdiv_r*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.
importc: "__gmpz_fdiv_r", dynlib: libgmp, cdecl.}
proc mpz_fdiv_r_2exp*(a2: mpz_ptr; a3: mpz_srcptr; a4: mp_bitcnt_t) {.
importc: "__gmpz_fdiv_r_2exp", dynlib: libgmp, cdecl.}
proc mpz_fdiv_r_2exp*(a2: var mpz_t; a3: mpz_t; a4: mp_bitcnt_t) {.
importc: "__gmpz_fdiv_r_2exp", dynlib: libgmp, cdecl.}
proc mpz_fdiv_r_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong): culong {.
importc: "__gmpz_fdiv_r_ui", dynlib: libgmp, cdecl.}
proc mpz_fdiv_r_ui*(a2: var mpz_t; a3: mpz_t; a4: culong): culong {.
importc: "__gmpz_fdiv_r_ui", dynlib: libgmp, cdecl.}
proc mpz_fdiv_ui*(a2: mpz_srcptr; a3: culong): culong {.
importc: "__gmpz_fdiv_ui", dynlib: libgmp, cdecl.}
proc mpz_fdiv_ui*(a2: mpz_t; a3: culong): culong {.importc: "__gmpz_fdiv_ui",
dynlib: libgmp, cdecl.}
proc mpz_fib_ui*(a2: mpz_ptr; a3: culong) {.importc: "__gmpz_fib_ui",
dynlib: libgmp, cdecl.}
proc mpz_fib_ui*(a2: var mpz_t; a3: culong) {.importc: "__gmpz_fib_ui",
dynlib: libgmp, cdecl.}
proc mpz_fib2_ui*(a2: mpz_ptr; a3: mpz_ptr; a4: culong) {.
importc: "__gmpz_fib2_ui", dynlib: libgmp, cdecl.}
proc mpz_fib2_ui*(a2: var mpz_t; a3: var mpz_t; a4: culong) {.
importc: "__gmpz_fib2_ui", dynlib: libgmp, cdecl.}
proc mpz_fits_sint_p*(a2: mpz_srcptr): cint {.importc: "__gmpz_fits_sint_p",
dynlib: libgmp, cdecl.}
proc mpz_fits_sint_p*(a2: mpz_t): cint {.importc: "__gmpz_fits_sint_p",
dynlib: libgmp, cdecl.}
proc mpz_fits_slong_p*(a2: mpz_srcptr): cint {.importc: "__gmpz_fits_slong_p",
dynlib: libgmp, cdecl.}
proc mpz_fits_slong_p*(a2: mpz_t): cint {.importc: "__gmpz_fits_slong_p",
dynlib: libgmp, cdecl.}
proc mpz_fits_sshort_p*(a2: mpz_srcptr): cint {.importc: "__gmpz_fits_sshort_p",
dynlib: libgmp, cdecl.}
proc mpz_fits_sshort_p*(a2: mpz_t): cint {.importc: "__gmpz_fits_sshort_p",
dynlib: libgmp, cdecl.}
proc mpz_gcd*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_gcd", dynlib: libgmp, cdecl.}
proc mpz_gcd*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.importc: "__gmpz_gcd",
dynlib: libgmp, cdecl.}
proc mpz_gcd_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong): culong {.
importc: "__gmpz_gcd_ui", dynlib: libgmp, cdecl.}
proc mpz_gcd_ui*(a2: var mpz_t; a3: mpz_t; a4: culong): culong {.
importc: "__gmpz_gcd_ui", dynlib: libgmp, cdecl.}
proc mpz_gcdext*(a2: mpz_ptr; a3: mpz_ptr; a4: mpz_ptr; a5: mpz_srcptr;
a6: mpz_srcptr) {.importc: "__gmpz_gcdext", dynlib: libgmp,
cdecl.}
proc mpz_gcdext*(a2: var mpz_t; a3: var mpz_t; a4: var mpz_t; a5: mpz_t;
a6: mpz_t) {.importc: "__gmpz_gcdext", dynlib: libgmp, cdecl.}
proc mpz_get_d*(a2: mpz_srcptr): cdouble {.importc: "__gmpz_get_d",
dynlib: libgmp, cdecl.}
proc mpz_get_d*(a2: mpz_t): cdouble {.importc: "__gmpz_get_d", dynlib: libgmp,
cdecl.}
proc mpz_get_d_2exp*(a2: ptr clong; a3: mpz_srcptr): cdouble {.
importc: "__gmpz_get_d_2exp", dynlib: libgmp, cdecl.}
proc mpz_get_d_2exp*(a2: ptr clong; a3: mpz_t): cdouble {.
importc: "__gmpz_get_d_2exp", dynlib: libgmp, cdecl.}
proc mpz_get_si*(a2: mpz_srcptr): clong {.importc: "__gmpz_get_si",
dynlib: libgmp, cdecl.}
proc mpz_get_si*(a2: mpz_t): clong {.importc: "__gmpz_get_si", dynlib: libgmp,
cdecl.}
proc mpz_get_str*(a2: cstring; a3: cint; a4: mpz_srcptr): cstring {.
importc: "__gmpz_get_str", dynlib: libgmp, cdecl.}
proc mpz_get_str*(a2: cstring; a3: cint; a4: mpz_t): cstring {.
importc: "__gmpz_get_str", dynlib: libgmp, cdecl.}
proc mpz_hamdist*(a2: mpz_srcptr; a3: mpz_srcptr): mp_bitcnt_t {.
importc: "__gmpz_hamdist", dynlib: libgmp, cdecl.}
proc mpz_hamdist*(a2: mpz_t; a3: mpz_t): mp_bitcnt_t {.
importc: "__gmpz_hamdist", dynlib: libgmp, cdecl.}
proc mpz_import*(a2: mpz_ptr; a3: csize; a4: cint; a5: csize; a6: cint;
a7: csize; a8: pointer) {.importc: "__gmpz_import",
dynlib: libgmp, cdecl.}
proc mpz_import*(a2: var mpz_t; a3: csize; a4: cint; a5: csize; a6: cint;
a7: csize; a8: pointer) {.importc: "__gmpz_import",
dynlib: libgmp, cdecl.}
proc mpz_init*(a2: mpz_ptr) {.importc: "__gmpz_init", dynlib: libgmp, cdecl.}
proc mpz_init*(a2: var mpz_t) {.importc: "__gmpz_init", dynlib: libgmp, cdecl.}
proc mpz_init2*(a2: mpz_ptr; a3: mp_bitcnt_t) {.importc: "__gmpz_init2",
dynlib: libgmp, cdecl.}
proc mpz_init2*(a2: var mpz_t; a3: mp_bitcnt_t) {.importc: "__gmpz_init2",
dynlib: libgmp, cdecl.}
proc mpz_inits*(a2: mpz_ptr) {.varargs, importc: "__gmpz_inits", dynlib: libgmp,
cdecl.}
proc mpz_inits*(a2: var mpz_t) {.varargs, importc: "__gmpz_inits",
dynlib: libgmp, cdecl.}
proc mpz_init_set*(a2: mpz_ptr; a3: mpz_srcptr) {.importc: "__gmpz_init_set",
dynlib: libgmp, cdecl.}
proc mpz_init_set*(a2: var mpz_t; a3: mpz_t) {.importc: "__gmpz_init_set",
dynlib: libgmp, cdecl.}
proc mpz_init_set_d*(a2: mpz_ptr; a3: cdouble) {.importc: "__gmpz_init_set_d",
dynlib: libgmp, cdecl.}
proc mpz_init_set_d*(a2: var mpz_t; a3: cdouble) {.importc: "__gmpz_init_set_d",
dynlib: libgmp, cdecl.}
proc mpz_init_set_si*(a2: mpz_ptr; a3: clong) {.importc: "__gmpz_init_set_si",
dynlib: libgmp, cdecl.}
proc mpz_init_set_si*(a2: var mpz_t; a3: clong) {.importc: "__gmpz_init_set_si",
dynlib: libgmp, cdecl.}
proc mpz_init_set_str*(a2: mpz_ptr; a3: cstring; a4: cint): cint {.
importc: "__gmpz_init_set_str", dynlib: libgmp, cdecl.}
proc mpz_init_set_str*(a2: var mpz_t; a3: cstring; a4: cint): cint {.
importc: "__gmpz_init_set_str", dynlib: libgmp, cdecl.}
proc mpz_init_set_ui*(a2: mpz_ptr; a3: culong) {.importc: "__gmpz_init_set_ui",
dynlib: libgmp, cdecl.}
proc mpz_init_set_ui*(a2: var mpz_t; a3: culong) {.
importc: "__gmpz_init_set_ui", dynlib: libgmp, cdecl.}
proc mpz_inp_raw*(a2: mpz_ptr; a3: File): csize {.importc: "__gmpz_inp_raw",
dynlib: libgmp, cdecl.}
proc mpz_inp_raw*(a2: var mpz_t; a3: File): csize {.
importc: "__gmpz_inp_raw", dynlib: libgmp, cdecl.}
proc mpz_inp_str*(a2: mpz_ptr; a3: File; a4: cint): csize {.
importc: "__gmpz_inp_str", dynlib: libgmp, cdecl.}
proc mpz_inp_str*(a2: var mpz_t; a3: File; a4: cint): csize {.
importc: "__gmpz_inp_str", dynlib: libgmp, cdecl.}
proc mpz_invert*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr): cint {.
importc: "__gmpz_invert", dynlib: libgmp, cdecl.}
proc mpz_invert*(a2: var mpz_t; a3: mpz_t; a4: mpz_t): cint {.
importc: "__gmpz_invert", dynlib: libgmp, cdecl.}
proc mpz_ior*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_ior", dynlib: libgmp, cdecl.}
proc mpz_ior*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.importc: "__gmpz_ior",
dynlib: libgmp, cdecl.}
proc mpz_jacobi*(a2: mpz_srcptr; a3: mpz_srcptr): cint {.
importc: "__gmpz_jacobi", dynlib: libgmp, cdecl.}
proc mpz_jacobi*(a2: mpz_t; a3: mpz_t): cint {.importc: "__gmpz_jacobi",
dynlib: libgmp, cdecl.}
proc mpz_kronecker_si*(a2: mpz_srcptr; a3: clong): cint {.
importc: "__gmpz_kronecker_si", dynlib: libgmp, cdecl.}
proc mpz_kronecker_si*(a2: mpz_t; a3: clong): cint {.
importc: "__gmpz_kronecker_si", dynlib: libgmp, cdecl.}
proc mpz_kronecker_ui*(a2: mpz_srcptr; a3: culong): cint {.
importc: "__gmpz_kronecker_ui", dynlib: libgmp, cdecl.}
proc mpz_kronecker_ui*(a2: mpz_t; a3: culong): cint {.
importc: "__gmpz_kronecker_ui", dynlib: libgmp, cdecl.}
proc mpz_si_kronecker*(a2: clong; a3: mpz_srcptr): cint {.
importc: "__gmpz_si_kronecker", dynlib: libgmp, cdecl.}
proc mpz_si_kronecker*(a2: clong; a3: mpz_t): cint {.
importc: "__gmpz_si_kronecker", dynlib: libgmp, cdecl.}
proc mpz_ui_kronecker*(a2: culong; a3: mpz_srcptr): cint {.
importc: "__gmpz_ui_kronecker", dynlib: libgmp, cdecl.}
proc mpz_ui_kronecker*(a2: culong; a3: mpz_t): cint {.
importc: "__gmpz_ui_kronecker", dynlib: libgmp, cdecl.}
proc mpz_lcm*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_lcm", dynlib: libgmp, cdecl.}
proc mpz_lcm*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.importc: "__gmpz_lcm",
dynlib: libgmp, cdecl.}
proc mpz_lcm_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong) {.
importc: "__gmpz_lcm_ui", dynlib: libgmp, cdecl.}
proc mpz_lcm_ui*(a2: var mpz_t; a3: mpz_t; a4: culong) {.
importc: "__gmpz_lcm_ui", dynlib: libgmp, cdecl.}
proc mpz_lucnum_ui*(a2: mpz_ptr; a3: culong) {.importc: "__gmpz_lucnum_ui",
dynlib: libgmp, cdecl.}
proc mpz_lucnum_ui*(a2: var mpz_t; a3: culong) {.importc: "__gmpz_lucnum_ui",
dynlib: libgmp, cdecl.}
proc mpz_lucnum2_ui*(a2: mpz_ptr; a3: mpz_ptr; a4: culong) {.
importc: "__gmpz_lucnum2_ui", dynlib: libgmp, cdecl.}
proc mpz_lucnum2_ui*(a2: var mpz_t; a3: var mpz_t; a4: culong) {.
importc: "__gmpz_lucnum2_ui", dynlib: libgmp, cdecl.}
proc mpz_millerrabin*(a2: mpz_srcptr; a3: cint): cint {.
importc: "__gmpz_millerrabin", dynlib: libgmp, cdecl.}
proc mpz_millerrabin*(a2: mpz_t; a3: cint): cint {.
importc: "__gmpz_millerrabin", dynlib: libgmp, cdecl.}
proc mpz_mod*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_mod", dynlib: libgmp, cdecl.}
proc mpz_mod*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.importc: "__gmpz_mod",
dynlib: libgmp, cdecl.}
proc mpz_mul*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_mul", dynlib: libgmp, cdecl.}
proc mpz_mul*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.importc: "__gmpz_mul",
dynlib: libgmp, cdecl.}
proc mpz_mul_2exp*(a2: mpz_ptr; a3: mpz_srcptr; a4: mp_bitcnt_t) {.
importc: "__gmpz_mul_2exp", dynlib: libgmp, cdecl.}
proc mpz_mul_2exp*(a2: var mpz_t; a3: mpz_t; a4: mp_bitcnt_t) {.
importc: "__gmpz_mul_2exp", dynlib: libgmp, cdecl.}
proc mpz_mul_si*(a2: mpz_ptr; a3: mpz_srcptr; a4: clong) {.
importc: "__gmpz_mul_si", dynlib: libgmp, cdecl.}
proc mpz_mul_si*(a2: var mpz_t; a3: mpz_t; a4: clong) {.
importc: "__gmpz_mul_si", dynlib: libgmp, cdecl.}
proc mpz_mul_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong) {.
importc: "__gmpz_mul_ui", dynlib: libgmp, cdecl.}
proc mpz_mul_ui*(a2: var mpz_t; a3: mpz_t; a4: culong) {.
importc: "__gmpz_mul_ui", dynlib: libgmp, cdecl.}
proc mpz_nextprime*(a2: mpz_ptr; a3: mpz_srcptr) {.importc: "__gmpz_nextprime",
dynlib: libgmp, cdecl.}
proc mpz_nextprime*(a2: var mpz_t; a3: mpz_t) {.importc: "__gmpz_nextprime",
dynlib: libgmp, cdecl.}
proc mpz_out_raw*(a2: File; a3: mpz_srcptr): csize {.
importc: "__gmpz_out_raw", dynlib: libgmp, cdecl.}
proc mpz_out_raw*(a2: File; a3: mpz_t): csize {.importc: "__gmpz_out_raw",
dynlib: libgmp, cdecl.}
proc mpz_out_str*(a2: File; a3: cint; a4: mpz_srcptr): csize {.
importc: "__gmpz_out_str", dynlib: libgmp, cdecl.}
proc mpz_out_str*(a2: File; a3: cint; a4: mpz_t): csize {.
importc: "__gmpz_out_str", dynlib: libgmp, cdecl.}
proc mpz_perfect_power_p*(a2: mpz_srcptr): cint {.
importc: "__gmpz_perfect_power_p", dynlib: libgmp, cdecl.}
proc mpz_perfect_power_p*(a2: mpz_t): cint {.importc: "__gmpz_perfect_power_p",
dynlib: libgmp, cdecl.}
proc mpz_pow_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong) {.
importc: "__gmpz_pow_ui", dynlib: libgmp, cdecl.}
proc mpz_pow_ui*(a2: var mpz_t; a3: mpz_t; a4: culong) {.
importc: "__gmpz_pow_ui", dynlib: libgmp, cdecl.}
proc mpz_powm*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr; a5: mpz_srcptr) {.
importc: "__gmpz_powm", dynlib: libgmp, cdecl.}
proc mpz_powm*(a2: var mpz_t; a3: mpz_t; a4: mpz_t; a5: mpz_t) {.
importc: "__gmpz_powm", dynlib: libgmp, cdecl.}
proc mpz_powm_sec*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr; a5: mpz_srcptr) {.
importc: "__gmpz_powm_sec", dynlib: libgmp, cdecl.}
proc mpz_powm_sec*(a2: var mpz_t; a3: mpz_t; a4: mpz_t; a5: mpz_t) {.
importc: "__gmpz_powm_sec", dynlib: libgmp, cdecl.}
proc mpz_powm_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong; a5: mpz_srcptr) {.
importc: "__gmpz_powm_ui", dynlib: libgmp, cdecl.}
proc mpz_powm_ui*(a2: var mpz_t; a3: mpz_t; a4: culong; a5: mpz_t) {.
importc: "__gmpz_powm_ui", dynlib: libgmp, cdecl.}
proc mpz_probab_prime_p*(a2: mpz_srcptr; a3: cint): cint {.
importc: "__gmpz_probab_prime_p", dynlib: libgmp, cdecl.}
proc mpz_probab_prime_p*(a2: mpz_t; a3: cint): cint {.
importc: "__gmpz_probab_prime_p", dynlib: libgmp, cdecl.}
proc mpz_random*(a2: mpz_ptr; a3: mp_size_t) {.importc: "__gmpz_random",
dynlib: libgmp, cdecl.}
proc mpz_random*(a2: var mpz_t; a3: mp_size_t) {.importc: "__gmpz_random",
dynlib: libgmp, cdecl.}
proc mpz_random2*(a2: mpz_ptr; a3: mp_size_t) {.importc: "__gmpz_random2",
dynlib: libgmp, cdecl.}
proc mpz_random2*(a2: var mpz_t; a3: mp_size_t) {.importc: "__gmpz_random2",
dynlib: libgmp, cdecl.}
proc mpz_realloc2*(a2: mpz_ptr; a3: mp_bitcnt_t) {.importc: "__gmpz_realloc2",
dynlib: libgmp, cdecl.}
proc mpz_realloc2*(a2: var mpz_t; a3: mp_bitcnt_t) {.importc: "__gmpz_realloc2",
dynlib: libgmp, cdecl.}
proc mpz_remove*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr): mp_bitcnt_t {.
importc: "__gmpz_remove", dynlib: libgmp, cdecl.}
proc mpz_remove*(a2: var mpz_t; a3: mpz_t; a4: mpz_t): mp_bitcnt_t {.
importc: "__gmpz_remove", dynlib: libgmp, cdecl.}
proc mpz_root*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong): cint {.
importc: "__gmpz_root", dynlib: libgmp, cdecl.}
proc mpz_root*(a2: var mpz_t; a3: mpz_t; a4: culong): cint {.
importc: "__gmpz_root", dynlib: libgmp, cdecl.}
proc mpz_rootrem*(a2: mpz_ptr; a3: mpz_ptr; a4: mpz_srcptr; a5: culong) {.
importc: "__gmpz_rootrem", dynlib: libgmp, cdecl.}
proc mpz_rootrem*(a2: var mpz_t; a3: var mpz_t; a4: mpz_t; a5: culong) {.
importc: "__gmpz_rootrem", dynlib: libgmp, cdecl.}
proc mpz_rrandomb*(a2: mpz_ptr; a3: gmp_randstate_t; a4: mp_bitcnt_t) {.
importc: "__gmpz_rrandomb", dynlib: libgmp, cdecl.}
proc mpz_rrandomb*(a2: var mpz_t; a3: gmp_randstate_t; a4: mp_bitcnt_t) {.
importc: "__gmpz_rrandomb", dynlib: libgmp, cdecl.}
proc mpz_scan0*(a2: mpz_srcptr; a3: mp_bitcnt_t): mp_bitcnt_t {.
importc: "__gmpz_scan0", dynlib: libgmp, cdecl.}
proc mpz_scan0*(a2: mpz_t; a3: mp_bitcnt_t): mp_bitcnt_t {.
importc: "__gmpz_scan0", dynlib: libgmp, cdecl.}
proc mpz_scan1*(a2: mpz_srcptr; a3: mp_bitcnt_t): mp_bitcnt_t {.
importc: "__gmpz_scan1", dynlib: libgmp, cdecl.}
proc mpz_scan1*(a2: mpz_t; a3: mp_bitcnt_t): mp_bitcnt_t {.
importc: "__gmpz_scan1", dynlib: libgmp, cdecl.}
proc mpz_set*(a2: mpz_ptr; a3: mpz_srcptr) {.importc: "__gmpz_set",
dynlib: libgmp, cdecl.}
proc mpz_set*(a2: var mpz_t; a3: mpz_t) {.importc: "__gmpz_set", dynlib: libgmp,
cdecl.}
proc mpz_set_d*(a2: mpz_ptr; a3: cdouble) {.importc: "__gmpz_set_d",
dynlib: libgmp, cdecl.}
proc mpz_set_d*(a2: var mpz_t; a3: cdouble) {.importc: "__gmpz_set_d",
dynlib: libgmp, cdecl.}
proc mpz_set_f*(a2: mpz_ptr; a3: mpf_srcptr) {.importc: "__gmpz_set_f",
dynlib: libgmp, cdecl.}
proc mpz_set_f*(a2: var mpz_t; a3: mpf_t) {.importc: "__gmpz_set_f",
dynlib: libgmp, cdecl.}
proc mpz_set_si*(a2: mpz_ptr; a3: clong) {.importc: "__gmpz_set_si",
dynlib: libgmp, cdecl.}
proc mpz_set_si*(a2: var mpz_t; a3: clong) {.importc: "__gmpz_set_si",
dynlib: libgmp, cdecl.}
proc mpz_set_str*(a2: mpz_ptr; a3: cstring; a4: cint): cint {.
importc: "__gmpz_set_str", dynlib: libgmp, cdecl.}
proc mpz_set_str*(a2: var mpz_t; a3: cstring; a4: cint): cint {.
importc: "__gmpz_set_str", dynlib: libgmp, cdecl.}
proc mpz_set_ui*(a2: mpz_ptr; a3: culong) {.importc: "__gmpz_set_ui",
dynlib: libgmp, cdecl.}
proc mpz_set_ui*(a2: var mpz_t; a3: culong) {.importc: "__gmpz_set_ui",
dynlib: libgmp, cdecl.}
proc mpz_setbit*(a2: mpz_ptr; a3: mp_bitcnt_t) {.importc: "__gmpz_setbit",
dynlib: libgmp, cdecl.}
proc mpz_setbit*(a2: var mpz_t; a3: mp_bitcnt_t) {.importc: "__gmpz_setbit",
dynlib: libgmp, cdecl.}
proc mpz_sizeinbase*(a2: mpz_srcptr; a3: cint): csize {.
importc: "__gmpz_sizeinbase", dynlib: libgmp, cdecl.}
proc mpz_sizeinbase*(a2: mpz_t; a3: cint): csize {.importc: "__gmpz_sizeinbase",
dynlib: libgmp, cdecl.}
proc mpz_sqrt*(a2: mpz_ptr; a3: mpz_srcptr) {.importc: "__gmpz_sqrt",
dynlib: libgmp, cdecl.}
proc mpz_sqrt*(a2: var mpz_t; a3: mpz_t) {.importc: "__gmpz_sqrt",
dynlib: libgmp, cdecl.}
proc mpz_sqrtrem*(a2: mpz_ptr; a3: mpz_ptr; a4: mpz_srcptr) {.
importc: "__gmpz_sqrtrem", dynlib: libgmp, cdecl.}
proc mpz_sqrtrem*(a2: var mpz_t; a3: var mpz_t; a4: mpz_t) {.
importc: "__gmpz_sqrtrem", dynlib: libgmp, cdecl.}
proc mpz_sub*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_sub", dynlib: libgmp, cdecl.}
proc mpz_sub*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.importc: "__gmpz_sub",
dynlib: libgmp, cdecl.}
proc mpz_sub_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong) {.
importc: "__gmpz_sub_ui", dynlib: libgmp, cdecl.}
proc mpz_sub_ui*(a2: var mpz_t; a3: mpz_t; a4: culong) {.
importc: "__gmpz_sub_ui", dynlib: libgmp, cdecl.}
proc mpz_ui_sub*(a2: mpz_ptr; a3: culong; a4: mpz_srcptr) {.
importc: "__gmpz_ui_sub", dynlib: libgmp, cdecl.}
proc mpz_ui_sub*(a2: var mpz_t; a3: culong; a4: mpz_t) {.
importc: "__gmpz_ui_sub", dynlib: libgmp, cdecl.}
proc mpz_submul*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_submul", dynlib: libgmp, cdecl.}
proc mpz_submul*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.
importc: "__gmpz_submul", dynlib: libgmp, cdecl.}
proc mpz_submul_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong) {.
importc: "__gmpz_submul_ui", dynlib: libgmp, cdecl.}
proc mpz_submul_ui*(a2: var mpz_t; a3: mpz_t; a4: culong) {.
importc: "__gmpz_submul_ui", dynlib: libgmp, cdecl.}
proc mpz_swap*(a2: mpz_ptr; a3: mpz_ptr) {.importc: "__gmpz_swap",
dynlib: libgmp, cdecl.}
proc mpz_swap*(a2: var mpz_t; a3: var mpz_t) {.importc: "__gmpz_swap",
dynlib: libgmp, cdecl.}
proc mpz_tdiv_ui*(a2: mpz_srcptr; a3: culong): culong {.
importc: "__gmpz_tdiv_ui", dynlib: libgmp, cdecl.}
proc mpz_tdiv_ui*(a2: mpz_t; a3: culong): culong {.importc: "__gmpz_tdiv_ui",
dynlib: libgmp, cdecl.}
proc mpz_tdiv_q*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_tdiv_q", dynlib: libgmp, cdecl.}
proc mpz_tdiv_q*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.
importc: "__gmpz_tdiv_q", dynlib: libgmp, cdecl.}
proc mpz_tdiv_q_2exp*(a2: mpz_ptr; a3: mpz_srcptr; a4: mp_bitcnt_t) {.
importc: "__gmpz_tdiv_q_2exp", dynlib: libgmp, cdecl.}
proc mpz_tdiv_q_2exp*(a2: var mpz_t; a3: mpz_t; a4: mp_bitcnt_t) {.
importc: "__gmpz_tdiv_q_2exp", dynlib: libgmp, cdecl.}
proc mpz_tdiv_q_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong): culong {.
importc: "__gmpz_tdiv_q_ui", dynlib: libgmp, cdecl.}
proc mpz_tdiv_q_ui*(a2: var mpz_t; a3: mpz_t; a4: culong): culong {.
importc: "__gmpz_tdiv_q_ui", dynlib: libgmp, cdecl.}
proc mpz_tdiv_qr*(a2: mpz_ptr; a3: mpz_ptr; a4: mpz_srcptr; a5: mpz_srcptr) {.
importc: "__gmpz_tdiv_qr", dynlib: libgmp, cdecl.}
proc mpz_tdiv_qr*(a2: var mpz_t; a3: var mpz_t; a4: mpz_t; a5: mpz_t) {.
importc: "__gmpz_tdiv_qr", dynlib: libgmp, cdecl.}
proc mpz_tdiv_qr_ui*(a2: mpz_ptr; a3: mpz_ptr; a4: mpz_srcptr; a5: culong): culong {.
importc: "__gmpz_tdiv_qr_ui", dynlib: libgmp, cdecl.}
proc mpz_tdiv_qr_ui*(a2: var mpz_t; a3: var mpz_t; a4: mpz_t; a5: culong): culong {.
importc: "__gmpz_tdiv_qr_ui", dynlib: libgmp, cdecl.}
proc mpz_tdiv_r*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_tdiv_r", dynlib: libgmp, cdecl.}
proc mpz_tdiv_r*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.
importc: "__gmpz_tdiv_r", dynlib: libgmp, cdecl.}
proc mpz_tdiv_r_2exp*(a2: mpz_ptr; a3: mpz_srcptr; a4: mp_bitcnt_t) {.
importc: "__gmpz_tdiv_r_2exp", dynlib: libgmp, cdecl.}
proc mpz_tdiv_r_2exp*(a2: var mpz_t; a3: mpz_t; a4: mp_bitcnt_t) {.
importc: "__gmpz_tdiv_r_2exp", dynlib: libgmp, cdecl.}
proc mpz_tdiv_r_ui*(a2: mpz_ptr; a3: mpz_srcptr; a4: culong): culong {.
importc: "__gmpz_tdiv_r_ui", dynlib: libgmp, cdecl.}
proc mpz_tdiv_r_ui*(a2: var mpz_t; a3: mpz_t; a4: culong): culong {.
importc: "__gmpz_tdiv_r_ui", dynlib: libgmp, cdecl.}
proc mpz_tstbit*(a2: mpz_srcptr; a3: mp_bitcnt_t): cint {.
importc: "__gmpz_tstbit", dynlib: libgmp, cdecl.}
proc mpz_tstbit*(a2: mpz_t; a3: mp_bitcnt_t): cint {.importc: "__gmpz_tstbit",
dynlib: libgmp, cdecl.}
proc mpz_ui_pow_ui*(a2: mpz_ptr; a3: culong; a4: culong) {.
importc: "__gmpz_ui_pow_ui", dynlib: libgmp, cdecl.}
proc mpz_ui_pow_ui*(a2: var mpz_t; a3: culong; a4: culong) {.
importc: "__gmpz_ui_pow_ui", dynlib: libgmp, cdecl.}
proc mpz_urandomb*(a2: mpz_ptr; a3: gmp_randstate_t; a4: mp_bitcnt_t) {.
importc: "__gmpz_urandomb", dynlib: libgmp, cdecl.}
proc mpz_urandomb*(a2: var mpz_t; a3: gmp_randstate_t; a4: mp_bitcnt_t) {.
importc: "__gmpz_urandomb", dynlib: libgmp, cdecl.}
proc mpz_urandomm*(a2: mpz_ptr; a3: gmp_randstate_t; a4: mpz_srcptr) {.
importc: "__gmpz_urandomm", dynlib: libgmp, cdecl.}
proc mpz_urandomm*(a2: var mpz_t; a3: gmp_randstate_t; a4: mpz_t) {.
importc: "__gmpz_urandomm", dynlib: libgmp, cdecl.}
proc mpz_xor*(a2: mpz_ptr; a3: mpz_srcptr; a4: mpz_srcptr) {.
importc: "__gmpz_xor", dynlib: libgmp, cdecl.}
proc mpz_xor*(a2: var mpz_t; a3: mpz_t; a4: mpz_t) {.importc: "__gmpz_xor",
dynlib: libgmp, cdecl.}
proc mpz_limbs_read*(a2: mpz_srcptr): mp_srcptr {.importc: "__gmpz_limbs_read",
dynlib: libgmp, cdecl.}
proc mpz_limbs_read*(a2: mpz_t): mp_srcptr {.importc: "__gmpz_limbs_read",
dynlib: libgmp, cdecl.}
proc mpz_limbs_write*(a2: mpz_ptr; a3: mp_size_t): mp_ptr {.
importc: "__gmpz_limbs_write", dynlib: libgmp, cdecl.}
proc mpz_limbs_write*(a2: var mpz_t; a3: mp_size_t): mp_ptr {.
importc: "__gmpz_limbs_write", dynlib: libgmp, cdecl.}
proc mpz_limbs_modify*(a2: mpz_ptr; a3: mp_size_t): mp_ptr {.
importc: "__gmpz_limbs_modify", dynlib: libgmp, cdecl.}
proc mpz_limbs_modify*(a2: var mpz_t; a3: mp_size_t): mp_ptr {.
importc: "__gmpz_limbs_modify", dynlib: libgmp, cdecl.}
proc mpz_limbs_finish*(a2: mpz_ptr; a3: mp_size_t) {.
importc: "__gmpz_limbs_finish", dynlib: libgmp, cdecl.}
proc mpz_limbs_finish*(a2: var mpz_t; a3: mp_size_t) {.
importc: "__gmpz_limbs_finish", dynlib: libgmp, cdecl.}
proc mpz_roinit_n*(a2: mpz_ptr; a3: mp_srcptr; a4: mp_size_t): mpz_srcptr {.
importc: "__gmpz_roinit_n", dynlib: libgmp, cdecl.}
proc mpz_roinit_n*(a2: var mpz_t; a3: var mp_limb_t; a4: mp_size_t): mpz_srcptr {.
importc: "__gmpz_roinit_n", dynlib: libgmp, cdecl.}
proc mpq_add*(a2: mpq_ptr; a3: mpq_srcptr; a4: mpq_srcptr) {.
importc: "__gmpq_add", dynlib: libgmp, cdecl.}
proc mpq_add*(a2: var mpq_t; a3: mpq_t; a4: mpq_t) {.importc: "__gmpq_add",
dynlib: libgmp, cdecl.}
proc mpq_canonicalize*(a2: mpq_ptr) {.importc: "__gmpq_canonicalize",
dynlib: libgmp, cdecl.}
proc mpq_canonicalize*(a2: var mpq_t) {.importc: "__gmpq_canonicalize",
dynlib: libgmp, cdecl.}
proc mpq_clear*(a2: mpq_ptr) {.importc: "__gmpq_clear", dynlib: libgmp, cdecl.}
proc mpq_clear*(a2: var mpq_t) {.importc: "__gmpq_clear", dynlib: libgmp, cdecl.}
proc mpq_clears*(a2: mpq_ptr) {.varargs, importc: "__gmpq_clears",
dynlib: libgmp, cdecl.}
proc mpq_clears*(a2: var mpq_t) {.varargs, importc: "__gmpq_clears",
dynlib: libgmp, cdecl.}
proc mpq_cmp*(a2: mpq_srcptr; a3: mpq_srcptr): cint {.importc: "__gmpq_cmp",
dynlib: libgmp, cdecl.}
proc mpq_cmp*(a2: mpq_t; a3: mpq_t): cint {.importc: "__gmpq_cmp",
dynlib: libgmp, cdecl.}
proc mpq_cmp_si*(a2: mpq_srcptr; a3: clong; a4: culong): cint {.
importc: "__gmpq_cmp_si", dynlib: libgmp, cdecl.}
proc mpq_cmp_si*(a2: mpq_t; a3: clong; a4: culong): cint {.
importc: "__gmpq_cmp_si", dynlib: libgmp, cdecl.}
proc mpq_cmp_ui*(a2: mpq_srcptr; a3: culong; a4: culong): cint {.
importc: "__gmpq_cmp_ui", dynlib: libgmp, cdecl.}
proc mpq_cmp_ui*(a2: mpq_t; a3: culong; a4: culong): cint {.
importc: "__gmpq_cmp_ui", dynlib: libgmp, cdecl.}
proc mpq_div*(a2: mpq_ptr; a3: mpq_srcptr; a4: mpq_srcptr) {.
importc: "__gmpq_div", dynlib: libgmp, cdecl.}
proc mpq_div*(a2: var mpq_t; a3: mpq_t; a4: mpq_t) {.importc: "__gmpq_div",
dynlib: libgmp, cdecl.}
proc mpq_div_2exp*(a2: mpq_ptr; a3: mpq_srcptr; a4: mp_bitcnt_t) {.
importc: "__gmpq_div_2exp", dynlib: libgmp, cdecl.}
proc mpq_div_2exp*(a2: var mpq_t; a3: mpq_t; a4: mp_bitcnt_t) {.
importc: "__gmpq_div_2exp", dynlib: libgmp, cdecl.}
proc mpq_equal*(a2: mpq_srcptr; a3: mpq_srcptr): cint {.importc: "__gmpq_equal",
dynlib: libgmp, cdecl.}
proc mpq_equal*(a2: mpq_t; a3: mpq_t): cint {.importc: "__gmpq_equal",
dynlib: libgmp, cdecl.}
proc mpq_get_num*(a2: mpz_ptr; a3: mpq_srcptr) {.importc: "__gmpq_get_num",
dynlib: libgmp, cdecl.}
proc mpq_get_num*(a2: var mpz_t; a3: mpq_t) {.importc: "__gmpq_get_num",
dynlib: libgmp, cdecl.}
proc mpq_get_den*(a2: mpz_ptr; a3: mpq_srcptr) {.importc: "__gmpq_get_den",
dynlib: libgmp, cdecl.}
proc mpq_get_den*(a2: var mpz_t; a3: mpq_t) {.importc: "__gmpq_get_den",
dynlib: libgmp, cdecl.}
proc mpq_get_d*(a2: mpq_srcptr): cdouble {.importc: "__gmpq_get_d",
dynlib: libgmp, cdecl.}
proc mpq_get_d*(a2: mpq_t): cdouble {.importc: "__gmpq_get_d", dynlib: libgmp,
cdecl.}
proc mpq_get_str*(a2: cstring; a3: cint; a4: mpq_srcptr): cstring {.
importc: "__gmpq_get_str", dynlib: libgmp, cdecl.}
proc mpq_get_str*(a2: cstring; a3: cint; a4: mpq_t): cstring {.
importc: "__gmpq_get_str", dynlib: libgmp, cdecl.}
proc mpq_init*(a2: mpq_ptr) {.importc: "__gmpq_init", dynlib: libgmp, cdecl.}
proc mpq_init*(a2: var mpq_t) {.importc: "__gmpq_init", dynlib: libgmp, cdecl.}
proc mpq_inits*(a2: mpq_ptr) {.varargs, importc: "__gmpq_inits", dynlib: libgmp,
cdecl.}
proc mpq_inits*(a2: var mpq_t) {.varargs, importc: "__gmpq_inits",
dynlib: libgmp, cdecl.}
proc mpq_inp_str*(a2: mpq_ptr; a3: File; a4: cint): csize {.
importc: "__gmpq_inp_str", dynlib: libgmp, cdecl.}
proc mpq_inp_str*(a2: var mpq_t; a3: File; a4: cint): csize {.
importc: "__gmpq_inp_str", dynlib: libgmp, cdecl.}
proc mpq_inv*(a2: mpq_ptr; a3: mpq_srcptr) {.importc: "__gmpq_inv",
dynlib: libgmp, cdecl.}
proc mpq_inv*(a2: var mpq_t; a3: mpq_t) {.importc: "__gmpq_inv", dynlib: libgmp,
cdecl.}
proc mpq_mul*(a2: mpq_ptr; a3: mpq_srcptr; a4: mpq_srcptr) {.
importc: "__gmpq_mul", dynlib: libgmp, cdecl.}
proc mpq_mul*(a2: var mpq_t; a3: mpq_t; a4: mpq_t) {.importc: "__gmpq_mul",
dynlib: libgmp, cdecl.}
proc mpq_mul_2exp*(a2: mpq_ptr; a3: mpq_srcptr; a4: mp_bitcnt_t) {.
importc: "__gmpq_mul_2exp", dynlib: libgmp, cdecl.}
proc mpq_mul_2exp*(a2: var mpq_t; a3: mpq_t; a4: mp_bitcnt_t) {.
importc: "__gmpq_mul_2exp", dynlib: libgmp, cdecl.}
proc mpq_out_str*(a2: File; a3: cint; a4: mpq_srcptr): csize {.
importc: "__gmpq_out_str", dynlib: libgmp, cdecl.}
proc mpq_out_str*(a2: File; a3: cint; a4: mpq_t): csize {.
importc: "__gmpq_out_str", dynlib: libgmp, cdecl.}
proc mpq_set*(a2: mpq_ptr; a3: mpq_srcptr) {.importc: "__gmpq_set",
dynlib: libgmp, cdecl.}
proc mpq_set*(a2: var mpq_t; a3: mpq_t) {.importc: "__gmpq_set", dynlib: libgmp,
cdecl.}
proc mpq_set_d*(a2: mpq_ptr; a3: cdouble) {.importc: "__gmpq_set_d",
dynlib: libgmp, cdecl.}
proc mpq_set_d*(a2: var mpq_t; a3: cdouble) {.importc: "__gmpq_set_d",
dynlib: libgmp, cdecl.}
proc mpq_set_den*(a2: mpq_ptr; a3: mpz_srcptr) {.importc: "__gmpq_set_den",
dynlib: libgmp, cdecl.}
proc mpq_set_den*(a2: var mpq_t; a3: mpz_t) {.importc: "__gmpq_set_den",
dynlib: libgmp, cdecl.}
proc mpq_set_f*(a2: mpq_ptr; a3: mpf_srcptr) {.importc: "__gmpq_set_f",
dynlib: libgmp, cdecl.}
proc mpq_set_f*(a2: var mpq_t; a3: mpf_t) {.importc: "__gmpq_set_f",
dynlib: libgmp, cdecl.}
proc mpq_set_num*(a2: mpq_ptr; a3: mpz_srcptr) {.importc: "__gmpq_set_num",
dynlib: libgmp, cdecl.}
proc mpq_set_num*(a2: var mpq_t; a3: mpz_t) {.importc: "__gmpq_set_num",
dynlib: libgmp, cdecl.}
proc mpq_set_si*(a2: mpq_ptr; a3: clong; a4: culong) {.importc: "__gmpq_set_si",
dynlib: libgmp, cdecl.}
proc mpq_set_si*(a2: var mpq_t; a3: clong; a4: culong) {.
importc: "__gmpq_set_si", dynlib: libgmp, cdecl.}
proc mpq_set_str*(a2: mpq_ptr; a3: cstring; a4: cint): cint {.
importc: "__gmpq_set_str", dynlib: libgmp, cdecl.}
proc mpq_set_str*(a2: var mpq_t; a3: cstring; a4: cint): cint {.
importc: "__gmpq_set_str", dynlib: libgmp, cdecl.}
proc mpq_set_ui*(a2: mpq_ptr; a3: culong; a4: culong) {.
importc: "__gmpq_set_ui", dynlib: libgmp, cdecl.}
proc mpq_set_ui*(a2: var mpq_t; a3: culong; a4: culong) {.
importc: "__gmpq_set_ui", dynlib: libgmp, cdecl.}
proc mpq_set_z*(a2: mpq_ptr; a3: mpz_srcptr) {.importc: "__gmpq_set_z",
dynlib: libgmp, cdecl.}
proc mpq_set_z*(a2: var mpq_t; a3: mpz_t) {.importc: "__gmpq_set_z",
dynlib: libgmp, cdecl.}
proc mpq_sub*(a2: mpq_ptr; a3: mpq_srcptr; a4: mpq_srcptr) {.
importc: "__gmpq_sub", dynlib: libgmp, cdecl.}
proc mpq_sub*(a2: var mpq_t; a3: mpq_t; a4: mpq_t) {.importc: "__gmpq_sub",
dynlib: libgmp, cdecl.}
proc mpq_swap*(a2: mpq_ptr; a3: mpq_ptr) {.importc: "__gmpq_swap",
dynlib: libgmp, cdecl.}
proc mpq_swap*(a2: var mpq_t; a3: var mpq_t) {.importc: "__gmpq_swap",
dynlib: libgmp, cdecl.}
proc mpf_abs*(a2: mpf_ptr; a3: mpf_srcptr) {.importc: "__gmpf_abs",
dynlib: libgmp, cdecl.}
proc mpf_abs*(a2: var mpf_t; a3: mpf_t) {.importc: "__gmpf_abs", dynlib: libgmp,
cdecl.}
proc mpf_add*(a2: mpf_ptr; a3: mpf_srcptr; a4: mpf_srcptr) {.
importc: "__gmpf_add", dynlib: libgmp, cdecl.}
proc mpf_add*(a2: var mpf_t; a3: mpf_t; a4: mpf_t) {.importc: "__gmpf_add",
dynlib: libgmp, cdecl.}
proc mpf_add_ui*(a2: mpf_ptr; a3: mpf_srcptr; a4: culong) {.
importc: "__gmpf_add_ui", dynlib: libgmp, cdecl.}
proc mpf_add_ui*(a2: var mpf_t; a3: mpf_t; a4: culong) {.
importc: "__gmpf_add_ui", dynlib: libgmp, cdecl.}
proc mpf_ceil*(a2: mpf_ptr; a3: mpf_srcptr) {.importc: "__gmpf_ceil",
dynlib: libgmp, cdecl.}
proc mpf_ceil*(a2: var mpf_t; a3: mpf_t) {.importc: "__gmpf_ceil",
dynlib: libgmp, cdecl.}
proc mpf_clear*(a2: mpf_ptr) {.importc: "__gmpf_clear", dynlib: libgmp, cdecl.}
proc mpf_clear*(a2: var mpf_t) {.importc: "__gmpf_clear", dynlib: libgmp, cdecl.}
proc mpf_clears*(a2: mpf_ptr) {.varargs, importc: "__gmpf_clears",
dynlib: libgmp, cdecl.}
proc mpf_clears*(a2: var mpf_t) {.varargs, importc: "__gmpf_clears",
dynlib: libgmp, cdecl.}
proc mpf_cmp*(a2: mpf_srcptr; a3: mpf_srcptr): cint {.importc: "__gmpf_cmp",
dynlib: libgmp, cdecl.}
proc mpf_cmp*(a2: mpf_t; a3: mpf_t): cint {.importc: "__gmpf_cmp",
dynlib: libgmp, cdecl.}
proc mpf_cmp_d*(a2: mpf_srcptr; a3: cdouble): cint {.importc: "__gmpf_cmp_d",
dynlib: libgmp, cdecl.}
proc mpf_cmp_d*(a2: mpf_t; a3: cdouble): cint {.importc: "__gmpf_cmp_d",
dynlib: libgmp, cdecl.}
proc mpf_cmp_si*(a2: mpf_srcptr; a3: clong): cint {.importc: "__gmpf_cmp_si",
dynlib: libgmp, cdecl.}
proc mpf_cmp_si*(a2: mpf_t; a3: clong): cint {.importc: "__gmpf_cmp_si",
dynlib: libgmp, cdecl.}
proc mpf_cmp_ui*(a2: mpf_srcptr; a3: culong): cint {.importc: "__gmpf_cmp_ui",
dynlib: libgmp, cdecl.}
proc mpf_cmp_ui*(a2: mpf_t; a3: culong): cint {.importc: "__gmpf_cmp_ui",
dynlib: libgmp, cdecl.}
proc mpf_div*(a2: mpf_ptr; a3: mpf_srcptr; a4: mpf_srcptr) {.
importc: "__gmpf_div", dynlib: libgmp, cdecl.}
proc mpf_div*(a2: var mpf_t; a3: mpf_t; a4: mpf_t) {.importc: "__gmpf_div",
dynlib: libgmp, cdecl.}
proc mpf_div_2exp*(a2: mpf_ptr; a3: mpf_srcptr; a4: mp_bitcnt_t) {.
importc: "__gmpf_div_2exp", dynlib: libgmp, cdecl.}
proc mpf_div_2exp*(a2: var mpf_t; a3: mpf_t; a4: mp_bitcnt_t) {.
importc: "__gmpf_div_2exp", dynlib: libgmp, cdecl.}
proc mpf_div_ui*(a2: mpf_ptr; a3: mpf_srcptr; a4: culong) {.
importc: "__gmpf_div_ui", dynlib: libgmp, cdecl.}
proc mpf_div_ui*(a2: var mpf_t; a3: mpf_t; a4: culong) {.
importc: "__gmpf_div_ui", dynlib: libgmp, cdecl.}
proc mpf_dump*(a2: mpf_srcptr) {.importc: "__gmpf_dump", dynlib: libgmp, cdecl.}
proc mpf_dump*(a2: mpf_t) {.importc: "__gmpf_dump", dynlib: libgmp, cdecl.}
proc mpf_eq*(a2: mpf_srcptr; a3: mpf_srcptr; a4: mp_bitcnt_t): cint {.
importc: "__gmpf_eq", dynlib: libgmp, cdecl.}
proc mpf_eq*(a2: mpf_t; a3: mpf_t; a4: mp_bitcnt_t): cint {.
importc: "__gmpf_eq", dynlib: libgmp, cdecl.}
proc mpf_fits_sint_p*(a2: mpf_srcptr): cint {.importc: "__gmpf_fits_sint_p",
dynlib: libgmp, cdecl.}
proc mpf_fits_sint_p*(a2: mpf_t): cint {.importc: "__gmpf_fits_sint_p",
dynlib: libgmp, cdecl.}
proc mpf_fits_slong_p*(a2: mpf_srcptr): cint {.importc: "__gmpf_fits_slong_p",
dynlib: libgmp, cdecl.}
proc mpf_fits_slong_p*(a2: mpf_t): cint {.importc: "__gmpf_fits_slong_p",
dynlib: libgmp, cdecl.}
proc mpf_fits_sshort_p*(a2: mpf_srcptr): cint {.importc: "__gmpf_fits_sshort_p",
dynlib: libgmp, cdecl.}
proc mpf_fits_sshort_p*(a2: mpf_t): cint {.importc: "__gmpf_fits_sshort_p",
dynlib: libgmp, cdecl.}
proc mpf_fits_uint_p*(a2: mpf_srcptr): cint {.importc: "__gmpf_fits_uint_p",
dynlib: libgmp, cdecl.}
proc mpf_fits_uint_p*(a2: mpf_t): cint {.importc: "__gmpf_fits_uint_p",
dynlib: libgmp, cdecl.}
proc mpf_fits_ulong_p*(a2: mpf_srcptr): cint {.importc: "__gmpf_fits_ulong_p",
dynlib: libgmp, cdecl.}
proc mpf_fits_ulong_p*(a2: mpf_t): cint {.importc: "__gmpf_fits_ulong_p",
dynlib: libgmp, cdecl.}
proc mpf_fits_ushort_p*(a2: mpf_srcptr): cint {.importc: "__gmpf_fits_ushort_p",
dynlib: libgmp, cdecl.}
proc mpf_fits_ushort_p*(a2: mpf_t): cint {.importc: "__gmpf_fits_ushort_p",
dynlib: libgmp, cdecl.}
proc mpf_floor*(a2: mpf_ptr; a3: mpf_srcptr) {.importc: "__gmpf_floor",
dynlib: libgmp, cdecl.}
proc mpf_floor*(a2: var mpf_t; a3: mpf_t) {.importc: "__gmpf_floor",
dynlib: libgmp, cdecl.}
proc mpf_get_d*(a2: mpf_srcptr): cdouble {.importc: "__gmpf_get_d",
dynlib: libgmp, cdecl.}
proc mpf_get_d*(a2: mpf_t): cdouble {.importc: "__gmpf_get_d", dynlib: libgmp,
cdecl.}
proc mpf_get_d_2exp*(a2: ptr clong; a3: mpf_srcptr): cdouble {.
importc: "__gmpf_get_d_2exp", dynlib: libgmp, cdecl.}
proc mpf_get_d_2exp*(a2: ptr clong; a3: mpf_t): cdouble {.
importc: "__gmpf_get_d_2exp", dynlib: libgmp, cdecl.}
proc mpf_get_default_prec*(): mp_bitcnt_t {.importc: "__gmpf_get_default_prec",
dynlib: libgmp, cdecl.}
proc mpf_get_prec*(a2: mpf_srcptr): mp_bitcnt_t {.importc: "__gmpf_get_prec",
dynlib: libgmp, cdecl.}
proc mpf_get_prec*(a2: mpf_t): mp_bitcnt_t {.importc: "__gmpf_get_prec",
dynlib: libgmp, cdecl.}
proc mpf_get_si*(a2: mpf_srcptr): clong {.importc: "__gmpf_get_si",
dynlib: libgmp, cdecl.}
proc mpf_get_si*(a2: mpf_t): clong {.importc: "__gmpf_get_si", dynlib: libgmp,
cdecl.}
proc mpf_get_str*(a2: cstring; a3: ptr mp_exp_t; a4: cint; a5: csize;
a6: mpf_srcptr): cstring {.importc: "__gmpf_get_str",
dynlib: libgmp, cdecl.}
proc mpf_get_str*(a2: cstring; a3: var mp_exp_t; a4: cint; a5: csize; a6: mpf_t): cstring {.
importc: "__gmpf_get_str", dynlib: libgmp, cdecl.}
proc mpf_get_ui*(a2: mpf_srcptr): culong {.importc: "__gmpf_get_ui",
dynlib: libgmp, cdecl.}
proc mpf_get_ui*(a2: mpf_t): culong {.importc: "__gmpf_get_ui", dynlib: libgmp,
cdecl.}
proc mpf_init*(a2: mpf_ptr) {.importc: "__gmpf_init", dynlib: libgmp, cdecl.}
proc mpf_init*(a2: var mpf_t) {.importc: "__gmpf_init", dynlib: libgmp, cdecl.}
proc mpf_init2*(a2: mpf_ptr; a3: mp_bitcnt_t) {.importc: "__gmpf_init2",
dynlib: libgmp, cdecl.}
proc mpf_init2*(a2: var mpf_t; a3: mp_bitcnt_t) {.importc: "__gmpf_init2",
dynlib: libgmp, cdecl.}
proc mpf_inits*(a2: mpf_ptr) {.varargs, importc: "__gmpf_inits", dynlib: libgmp,
cdecl.}
proc mpf_inits*(a2: var mpf_t) {.varargs, importc: "__gmpf_inits",
dynlib: libgmp, cdecl.}
proc mpf_init_set*(a2: mpf_ptr; a3: mpf_srcptr) {.importc: "__gmpf_init_set",
dynlib: libgmp, cdecl.}
proc mpf_init_set*(a2: var mpf_t; a3: mpf_t) {.importc: "__gmpf_init_set",
dynlib: libgmp, cdecl.}
proc mpf_init_set_d*(a2: mpf_ptr; a3: cdouble) {.importc: "__gmpf_init_set_d",
dynlib: libgmp, cdecl.}
proc mpf_init_set_d*(a2: var mpf_t; a3: cdouble) {.importc: "__gmpf_init_set_d",
dynlib: libgmp, cdecl.}
proc mpf_init_set_si*(a2: mpf_ptr; a3: clong) {.importc: "__gmpf_init_set_si",
dynlib: libgmp, cdecl.}
proc mpf_init_set_si*(a2: var mpf_t; a3: clong) {.importc: "__gmpf_init_set_si",
dynlib: libgmp, cdecl.}
proc mpf_init_set_str*(a2: mpf_ptr; a3: cstring; a4: cint): cint {.
importc: "__gmpf_init_set_str", dynlib: libgmp, cdecl.}
proc mpf_init_set_str*(a2: var mpf_t; a3: cstring; a4: cint): cint {.
importc: "__gmpf_init_set_str", dynlib: libgmp, cdecl.}
proc mpf_init_set_ui*(a2: mpf_ptr; a3: culong) {.importc: "__gmpf_init_set_ui",
dynlib: libgmp, cdecl.}
proc mpf_init_set_ui*(a2: var mpf_t; a3: culong) {.
importc: "__gmpf_init_set_ui", dynlib: libgmp, cdecl.}
proc mpf_inp_str*(a2: mpf_ptr; a3: File; a4: cint): csize {.
importc: "__gmpf_inp_str", dynlib: libgmp, cdecl.}
proc mpf_inp_str*(a2: var mpf_t; a3: File; a4: cint): csize {.
importc: "__gmpf_inp_str", dynlib: libgmp, cdecl.}
proc mpf_integer_p*(a2: mpf_srcptr): cint {.importc: "__gmpf_integer_p",
dynlib: libgmp, cdecl.}
proc mpf_integer_p*(a2: mpf_t): cint {.importc: "__gmpf_integer_p",
dynlib: libgmp, cdecl.}
proc mpf_mul*(a2: mpf_ptr; a3: mpf_srcptr; a4: mpf_srcptr) {.
importc: "__gmpf_mul", dynlib: libgmp, cdecl.}
proc mpf_mul*(a2: var mpf_t; a3: mpf_t; a4: mpf_t) {.importc: "__gmpf_mul",
dynlib: libgmp, cdecl.}
proc mpf_mul_2exp*(a2: mpf_ptr; a3: mpf_srcptr; a4: mp_bitcnt_t) {.
importc: "__gmpf_mul_2exp", dynlib: libgmp, cdecl.}
proc mpf_mul_2exp*(a2: var mpf_t; a3: mpf_t; a4: mp_bitcnt_t) {.
importc: "__gmpf_mul_2exp", dynlib: libgmp, cdecl.}
proc mpf_mul_ui*(a2: mpf_ptr; a3: mpf_srcptr; a4: culong) {.
importc: "__gmpf_mul_ui", dynlib: libgmp, cdecl.}
proc mpf_mul_ui*(a2: var mpf_t; a3: mpf_t; a4: culong) {.
importc: "__gmpf_mul_ui", dynlib: libgmp, cdecl.}
proc mpf_neg*(a2: mpf_ptr; a3: mpf_srcptr) {.importc: "__gmpf_neg",