File indexing completed on 2025-01-17 09:55:30
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 #ifndef __GMP_H__
0033
0034 #if defined (__cplusplus)
0035 #include <iosfwd> /* for std::istream, std::ostream, std::string */
0036 #include <cstdio>
0037 #endif
0038
0039
0040
0041 #if ! defined (__GMP_WITHIN_CONFIGURE)
0042 #define __GMP_HAVE_HOST_CPU_FAMILY_power 0
0043 #define __GMP_HAVE_HOST_CPU_FAMILY_powerpc 0
0044 #define GMP_LIMB_BITS 64
0045 #define GMP_NAIL_BITS 0
0046 #endif
0047 #define GMP_NUMB_BITS (GMP_LIMB_BITS - GMP_NAIL_BITS)
0048 #define GMP_NUMB_MASK ((~ __GMP_CAST (mp_limb_t, 0)) >> GMP_NAIL_BITS)
0049 #define GMP_NUMB_MAX GMP_NUMB_MASK
0050 #define GMP_NAIL_MASK (~ GMP_NUMB_MASK)
0051
0052
0053 #ifndef __GNU_MP__
0054 #define __GNU_MP__ 6
0055
0056 #include <stddef.h> /* for size_t */
0057 #include <limits.h>
0058
0059
0060 #if ! defined (__GMP_WITHIN_CONFIGURE)
0061
0062 #define __GMP_LIBGMP_DLL 0
0063 #endif
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103 #if defined (__GNUC__)
0104 #define __GMP_DECLSPEC_EXPORT __declspec(__dllexport__)
0105 #define __GMP_DECLSPEC_IMPORT __declspec(__dllimport__)
0106 #endif
0107 #if defined (_MSC_VER) || defined (__BORLANDC__)
0108 #define __GMP_DECLSPEC_EXPORT __declspec(dllexport)
0109 #define __GMP_DECLSPEC_IMPORT __declspec(dllimport)
0110 #endif
0111 #ifdef __WATCOMC__
0112 #define __GMP_DECLSPEC_EXPORT __export
0113 #define __GMP_DECLSPEC_IMPORT __import
0114 #endif
0115 #ifdef __IBMC__
0116 #define __GMP_DECLSPEC_EXPORT _Export
0117 #define __GMP_DECLSPEC_IMPORT _Import
0118 #endif
0119
0120 #if __GMP_LIBGMP_DLL
0121 #ifdef __GMP_WITHIN_GMP
0122
0123 #define __GMP_DECLSPEC __GMP_DECLSPEC_EXPORT
0124 #else
0125
0126 #define __GMP_DECLSPEC __GMP_DECLSPEC_IMPORT
0127 #endif
0128 #else
0129
0130 #define __GMP_DECLSPEC
0131 #endif
0132
0133
0134 #ifdef __GMP_SHORT_LIMB
0135 typedef unsigned int mp_limb_t;
0136 typedef int mp_limb_signed_t;
0137 #else
0138 #ifdef _LONG_LONG_LIMB
0139 typedef unsigned long long int mp_limb_t;
0140 typedef long long int mp_limb_signed_t;
0141 #else
0142 typedef unsigned long int mp_limb_t;
0143 typedef long int mp_limb_signed_t;
0144 #endif
0145 #endif
0146 typedef unsigned long int mp_bitcnt_t;
0147
0148
0149
0150
0151 typedef struct
0152 {
0153 int _mp_alloc;
0154
0155 int _mp_size;
0156
0157
0158 mp_limb_t *_mp_d;
0159 } __mpz_struct;
0160
0161 #endif
0162
0163
0164 typedef __mpz_struct MP_INT;
0165 typedef __mpz_struct mpz_t[1];
0166
0167 typedef mp_limb_t * mp_ptr;
0168 typedef const mp_limb_t * mp_srcptr;
0169 #if defined (_CRAY) && ! defined (_CRAYMPP)
0170
0171 #define __GMP_MP_SIZE_T_INT 1
0172 typedef int mp_size_t;
0173 typedef int mp_exp_t;
0174 #else
0175 #define __GMP_MP_SIZE_T_INT 0
0176 typedef long int mp_size_t;
0177 typedef long int mp_exp_t;
0178 #endif
0179
0180 typedef struct
0181 {
0182 __mpz_struct _mp_num;
0183 __mpz_struct _mp_den;
0184 } __mpq_struct;
0185
0186 typedef __mpq_struct MP_RAT;
0187 typedef __mpq_struct mpq_t[1];
0188
0189 typedef struct
0190 {
0191 int _mp_prec;
0192
0193
0194
0195 int _mp_size;
0196
0197
0198 mp_exp_t _mp_exp;
0199 mp_limb_t *_mp_d;
0200 } __mpf_struct;
0201
0202
0203 typedef __mpf_struct mpf_t[1];
0204
0205
0206 typedef enum
0207 {
0208 GMP_RAND_ALG_DEFAULT = 0,
0209 GMP_RAND_ALG_LC = GMP_RAND_ALG_DEFAULT
0210 } gmp_randalg_t;
0211
0212
0213 typedef struct
0214 {
0215 mpz_t _mp_seed;
0216 gmp_randalg_t _mp_alg;
0217 union {
0218 void *_mp_lc;
0219 } _mp_algdata;
0220 } __gmp_randstate_struct;
0221 typedef __gmp_randstate_struct gmp_randstate_t[1];
0222
0223
0224
0225 typedef const __mpz_struct *mpz_srcptr;
0226 typedef __mpz_struct *mpz_ptr;
0227 typedef const __mpf_struct *mpf_srcptr;
0228 typedef __mpf_struct *mpf_ptr;
0229 typedef const __mpq_struct *mpq_srcptr;
0230 typedef __mpq_struct *mpq_ptr;
0231 typedef __gmp_randstate_struct *gmp_randstate_ptr;
0232 typedef const __gmp_randstate_struct *gmp_randstate_srcptr;
0233
0234
0235 #if __GMP_LIBGMP_DLL
0236 #ifdef __GMP_WITHIN_GMPXX
0237
0238 #define __GMP_DECLSPEC_XX __GMP_DECLSPEC_EXPORT
0239 #else
0240
0241 #define __GMP_DECLSPEC_XX __GMP_DECLSPEC_IMPORT
0242 #endif
0243 #else
0244
0245 #define __GMP_DECLSPEC_XX
0246 #endif
0247
0248
0249 #ifndef __MPN
0250 #define __MPN(x) __gmpn_##x
0251 #endif
0252
0253
0254
0255 #if defined (FILE) \
0256 || defined (H_STDIO) \
0257 || defined (_H_STDIO) \
0258 || defined (_STDIO_H) \
0259 || defined (_STDIO_H_) \
0260 || defined (__STDIO_H) \
0261 || defined (__STDIO_H__) \
0262 || defined (_STDIO_INCLUDED) \
0263 || defined (__dj_include_stdio_h_) \
0264 || defined (_FILE_DEFINED) \
0265 || defined (__STDIO__) \
0266 || defined (_MSL_STDIO_H) \
0267 || defined (_STDIO_H_INCLUDED) \
0268 || defined (_ISO_STDIO_ISO_H) \
0269 || defined (__STDIO_LOADED) \
0270 || defined (_STDIO) \
0271 || defined (__DEFINED_FILE)
0272 #define _GMP_H_HAVE_FILE 1
0273 #endif
0274
0275
0276
0277
0278
0279 #if defined (_OBSTACK_H)
0280 #define _GMP_H_HAVE_OBSTACK 1
0281 #endif
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292 #ifdef va_start
0293 #define _GMP_H_HAVE_VA_LIST 1
0294 #endif
0295
0296
0297 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
0298 #define __GMP_GNUC_PREREQ(maj, min) \
0299 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
0300 #else
0301 #define __GMP_GNUC_PREREQ(maj, min) 0
0302 #endif
0303
0304
0305
0306
0307
0308
0309 #if __GMP_GNUC_PREREQ (2,96) && ! defined (__GMP_NO_ATTRIBUTE_CONST_PURE)
0310 #define __GMP_ATTRIBUTE_PURE __attribute__ ((__pure__))
0311 #else
0312 #define __GMP_ATTRIBUTE_PURE
0313 #endif
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323 #ifdef __cplusplus
0324 #define __GMP_CAST(type, expr) (static_cast<type> (expr))
0325 #else
0326 #define __GMP_CAST(type, expr) ((type) (expr))
0327 #endif
0328
0329
0330
0331
0332
0333
0334
0335
0336
0337
0338
0339
0340
0341
0342
0343
0344
0345
0346
0347 #if defined (__cplusplus)
0348 #if __cplusplus >= 201103L
0349 #define __GMP_NOTHROW noexcept
0350 #else
0351 #define __GMP_NOTHROW throw ()
0352 #endif
0353 #else
0354 #define __GMP_NOTHROW
0355 #endif
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367 #ifdef __GNUC__
0368 #if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2) \
0369 || (defined __GNUC_GNU_INLINE__ && defined __cplusplus)
0370 #define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
0371 #else
0372 #define __GMP_EXTERN_INLINE extern __inline__
0373 #endif
0374 #define __GMP_INLINE_PROTOTYPES 1
0375 #endif
0376
0377
0378
0379
0380
0381
0382
0383
0384
0385 #ifdef __DECC
0386 #define __GMP_EXTERN_INLINE static __inline
0387 #endif
0388
0389
0390
0391
0392
0393
0394
0395
0396 #ifdef __SCO_VERSION__
0397 #if __SCO_VERSION__ > 400000000 && __STDC__ != 1 \
0398 && ! defined (__GMP_EXTERN_INLINE)
0399 #define __GMP_EXTERN_INLINE static inline
0400 #endif
0401 #endif
0402
0403
0404 #ifdef _MSC_VER
0405 #define __GMP_EXTERN_INLINE __inline
0406 #endif
0407
0408
0409 #if defined (__SUNPRO_C) && __SUNPRO_C >= 0x560 \
0410 && ! defined (__GMP_EXTERN_INLINE)
0411 #define __GMP_EXTERN_INLINE inline
0412 #endif
0413
0414
0415 #if defined (__SUNPRO_C) && __SUNPRO_C >= 0x540 \
0416 && ! defined (__GMP_EXTERN_INLINE)
0417 #define __GMP_EXTERN_INLINE static inline
0418 #endif
0419
0420
0421
0422
0423
0424 #if defined (__cplusplus) && ! defined (__GMP_EXTERN_INLINE)
0425 #define __GMP_EXTERN_INLINE inline
0426 #endif
0427
0428
0429
0430
0431
0432
0433
0434 #if defined (__GMP_WITHIN_CONFIGURE) && ! __GMP_WITHIN_CONFIGURE_INLINE
0435 #undef __GMP_EXTERN_INLINE
0436 #endif
0437
0438
0439
0440
0441 #ifdef __GMP_EXTERN_INLINE
0442 #ifndef __GMP_INLINE_PROTOTYPES
0443 #define __GMP_INLINE_PROTOTYPES 0
0444 #endif
0445 #else
0446 #define __GMP_INLINE_PROTOTYPES 1
0447 #endif
0448
0449
0450 #define __GMP_ABS(x) ((x) >= 0 ? (x) : -(x))
0451 #define __GMP_MAX(h,i) ((h) > (i) ? (h) : (i))
0452
0453
0454
0455 #if __GMP_GNUC_PREREQ (3,0)
0456 #define __GMP_LIKELY(cond) __builtin_expect ((cond) != 0, 1)
0457 #define __GMP_UNLIKELY(cond) __builtin_expect ((cond) != 0, 0)
0458 #else
0459 #define __GMP_LIKELY(cond) (cond)
0460 #define __GMP_UNLIKELY(cond) (cond)
0461 #endif
0462
0463 #ifdef _CRAY
0464 #define __GMP_CRAY_Pragma(str) _Pragma (str)
0465 #else
0466 #define __GMP_CRAY_Pragma(str)
0467 #endif
0468
0469
0470
0471 #define mpq_numref(Q) (&((Q)->_mp_num))
0472 #define mpq_denref(Q) (&((Q)->_mp_den))
0473
0474
0475 #if defined (__cplusplus)
0476 extern "C" {
0477 using std::FILE;
0478 #endif
0479
0480 #define mp_set_memory_functions __gmp_set_memory_functions
0481 __GMP_DECLSPEC void mp_set_memory_functions (void *(*) (size_t),
0482 void *(*) (void *, size_t, size_t),
0483 void (*) (void *, size_t)) __GMP_NOTHROW;
0484
0485 #define mp_get_memory_functions __gmp_get_memory_functions
0486 __GMP_DECLSPEC void mp_get_memory_functions (void *(**) (size_t),
0487 void *(**) (void *, size_t, size_t),
0488 void (**) (void *, size_t)) __GMP_NOTHROW;
0489
0490 #define mp_bits_per_limb __gmp_bits_per_limb
0491 __GMP_DECLSPEC extern const int mp_bits_per_limb;
0492
0493 #define gmp_errno __gmp_errno
0494 __GMP_DECLSPEC extern int gmp_errno;
0495
0496 #define gmp_version __gmp_version
0497 __GMP_DECLSPEC extern const char * const gmp_version;
0498
0499
0500
0501
0502
0503 #define gmp_randinit __gmp_randinit
0504 __GMP_DECLSPEC void gmp_randinit (gmp_randstate_ptr, gmp_randalg_t, ...);
0505
0506 #define gmp_randinit_default __gmp_randinit_default
0507 __GMP_DECLSPEC void gmp_randinit_default (gmp_randstate_ptr);
0508
0509 #define gmp_randinit_lc_2exp __gmp_randinit_lc_2exp
0510 __GMP_DECLSPEC void gmp_randinit_lc_2exp (gmp_randstate_ptr, mpz_srcptr, unsigned long int, mp_bitcnt_t);
0511
0512 #define gmp_randinit_lc_2exp_size __gmp_randinit_lc_2exp_size
0513 __GMP_DECLSPEC int gmp_randinit_lc_2exp_size (gmp_randstate_ptr, mp_bitcnt_t);
0514
0515 #define gmp_randinit_mt __gmp_randinit_mt
0516 __GMP_DECLSPEC void gmp_randinit_mt (gmp_randstate_ptr);
0517
0518 #define gmp_randinit_set __gmp_randinit_set
0519 __GMP_DECLSPEC void gmp_randinit_set (gmp_randstate_ptr, gmp_randstate_srcptr);
0520
0521 #define gmp_randseed __gmp_randseed
0522 __GMP_DECLSPEC void gmp_randseed (gmp_randstate_ptr, mpz_srcptr);
0523
0524 #define gmp_randseed_ui __gmp_randseed_ui
0525 __GMP_DECLSPEC void gmp_randseed_ui (gmp_randstate_ptr, unsigned long int);
0526
0527 #define gmp_randclear __gmp_randclear
0528 __GMP_DECLSPEC void gmp_randclear (gmp_randstate_ptr);
0529
0530 #define gmp_urandomb_ui __gmp_urandomb_ui
0531 __GMP_DECLSPEC unsigned long gmp_urandomb_ui (gmp_randstate_ptr, unsigned long);
0532
0533 #define gmp_urandomm_ui __gmp_urandomm_ui
0534 __GMP_DECLSPEC unsigned long gmp_urandomm_ui (gmp_randstate_ptr, unsigned long);
0535
0536
0537
0538
0539 #define gmp_asprintf __gmp_asprintf
0540 __GMP_DECLSPEC int gmp_asprintf (char **, const char *, ...);
0541
0542 #define gmp_fprintf __gmp_fprintf
0543 #ifdef _GMP_H_HAVE_FILE
0544 __GMP_DECLSPEC int gmp_fprintf (FILE *, const char *, ...);
0545 #endif
0546
0547 #define gmp_obstack_printf __gmp_obstack_printf
0548 #if defined (_GMP_H_HAVE_OBSTACK)
0549 __GMP_DECLSPEC int gmp_obstack_printf (struct obstack *, const char *, ...);
0550 #endif
0551
0552 #define gmp_obstack_vprintf __gmp_obstack_vprintf
0553 #if defined (_GMP_H_HAVE_OBSTACK) && defined (_GMP_H_HAVE_VA_LIST)
0554 __GMP_DECLSPEC int gmp_obstack_vprintf (struct obstack *, const char *, va_list);
0555 #endif
0556
0557 #define gmp_printf __gmp_printf
0558 __GMP_DECLSPEC int gmp_printf (const char *, ...);
0559
0560 #define gmp_snprintf __gmp_snprintf
0561 __GMP_DECLSPEC int gmp_snprintf (char *, size_t, const char *, ...);
0562
0563 #define gmp_sprintf __gmp_sprintf
0564 __GMP_DECLSPEC int gmp_sprintf (char *, const char *, ...);
0565
0566 #define gmp_vasprintf __gmp_vasprintf
0567 #if defined (_GMP_H_HAVE_VA_LIST)
0568 __GMP_DECLSPEC int gmp_vasprintf (char **, const char *, va_list);
0569 #endif
0570
0571 #define gmp_vfprintf __gmp_vfprintf
0572 #if defined (_GMP_H_HAVE_FILE) && defined (_GMP_H_HAVE_VA_LIST)
0573 __GMP_DECLSPEC int gmp_vfprintf (FILE *, const char *, va_list);
0574 #endif
0575
0576 #define gmp_vprintf __gmp_vprintf
0577 #if defined (_GMP_H_HAVE_VA_LIST)
0578 __GMP_DECLSPEC int gmp_vprintf (const char *, va_list);
0579 #endif
0580
0581 #define gmp_vsnprintf __gmp_vsnprintf
0582 #if defined (_GMP_H_HAVE_VA_LIST)
0583 __GMP_DECLSPEC int gmp_vsnprintf (char *, size_t, const char *, va_list);
0584 #endif
0585
0586 #define gmp_vsprintf __gmp_vsprintf
0587 #if defined (_GMP_H_HAVE_VA_LIST)
0588 __GMP_DECLSPEC int gmp_vsprintf (char *, const char *, va_list);
0589 #endif
0590
0591
0592
0593
0594 #define gmp_fscanf __gmp_fscanf
0595 #ifdef _GMP_H_HAVE_FILE
0596 __GMP_DECLSPEC int gmp_fscanf (FILE *, const char *, ...);
0597 #endif
0598
0599 #define gmp_scanf __gmp_scanf
0600 __GMP_DECLSPEC int gmp_scanf (const char *, ...);
0601
0602 #define gmp_sscanf __gmp_sscanf
0603 __GMP_DECLSPEC int gmp_sscanf (const char *, const char *, ...);
0604
0605 #define gmp_vfscanf __gmp_vfscanf
0606 #if defined (_GMP_H_HAVE_FILE) && defined (_GMP_H_HAVE_VA_LIST)
0607 __GMP_DECLSPEC int gmp_vfscanf (FILE *, const char *, va_list);
0608 #endif
0609
0610 #define gmp_vscanf __gmp_vscanf
0611 #if defined (_GMP_H_HAVE_VA_LIST)
0612 __GMP_DECLSPEC int gmp_vscanf (const char *, va_list);
0613 #endif
0614
0615 #define gmp_vsscanf __gmp_vsscanf
0616 #if defined (_GMP_H_HAVE_VA_LIST)
0617 __GMP_DECLSPEC int gmp_vsscanf (const char *, const char *, va_list);
0618 #endif
0619
0620
0621
0622
0623 #define _mpz_realloc __gmpz_realloc
0624 #define mpz_realloc __gmpz_realloc
0625 __GMP_DECLSPEC void *_mpz_realloc (mpz_ptr, mp_size_t);
0626
0627 #define mpz_abs __gmpz_abs
0628 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_abs)
0629 __GMP_DECLSPEC void mpz_abs (mpz_ptr, mpz_srcptr);
0630 #endif
0631
0632 #define mpz_add __gmpz_add
0633 __GMP_DECLSPEC void mpz_add (mpz_ptr, mpz_srcptr, mpz_srcptr);
0634
0635 #define mpz_add_ui __gmpz_add_ui
0636 __GMP_DECLSPEC void mpz_add_ui (mpz_ptr, mpz_srcptr, unsigned long int);
0637
0638 #define mpz_addmul __gmpz_addmul
0639 __GMP_DECLSPEC void mpz_addmul (mpz_ptr, mpz_srcptr, mpz_srcptr);
0640
0641 #define mpz_addmul_ui __gmpz_addmul_ui
0642 __GMP_DECLSPEC void mpz_addmul_ui (mpz_ptr, mpz_srcptr, unsigned long int);
0643
0644 #define mpz_and __gmpz_and
0645 __GMP_DECLSPEC void mpz_and (mpz_ptr, mpz_srcptr, mpz_srcptr);
0646
0647 #define mpz_array_init __gmpz_array_init
0648 __GMP_DECLSPEC void mpz_array_init (mpz_ptr, mp_size_t, mp_size_t);
0649
0650 #define mpz_bin_ui __gmpz_bin_ui
0651 __GMP_DECLSPEC void mpz_bin_ui (mpz_ptr, mpz_srcptr, unsigned long int);
0652
0653 #define mpz_bin_uiui __gmpz_bin_uiui
0654 __GMP_DECLSPEC void mpz_bin_uiui (mpz_ptr, unsigned long int, unsigned long int);
0655
0656 #define mpz_cdiv_q __gmpz_cdiv_q
0657 __GMP_DECLSPEC void mpz_cdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
0658
0659 #define mpz_cdiv_q_2exp __gmpz_cdiv_q_2exp
0660 __GMP_DECLSPEC void mpz_cdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
0661
0662 #define mpz_cdiv_q_ui __gmpz_cdiv_q_ui
0663 __GMP_DECLSPEC unsigned long int mpz_cdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);
0664
0665 #define mpz_cdiv_qr __gmpz_cdiv_qr
0666 __GMP_DECLSPEC void mpz_cdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
0667
0668 #define mpz_cdiv_qr_ui __gmpz_cdiv_qr_ui
0669 __GMP_DECLSPEC unsigned long int mpz_cdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
0670
0671 #define mpz_cdiv_r __gmpz_cdiv_r
0672 __GMP_DECLSPEC void mpz_cdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
0673
0674 #define mpz_cdiv_r_2exp __gmpz_cdiv_r_2exp
0675 __GMP_DECLSPEC void mpz_cdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
0676
0677 #define mpz_cdiv_r_ui __gmpz_cdiv_r_ui
0678 __GMP_DECLSPEC unsigned long int mpz_cdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);
0679
0680 #define mpz_cdiv_ui __gmpz_cdiv_ui
0681 __GMP_DECLSPEC unsigned long int mpz_cdiv_ui (mpz_srcptr, unsigned long int) __GMP_ATTRIBUTE_PURE;
0682
0683 #define mpz_clear __gmpz_clear
0684 __GMP_DECLSPEC void mpz_clear (mpz_ptr);
0685
0686 #define mpz_clears __gmpz_clears
0687 __GMP_DECLSPEC void mpz_clears (mpz_ptr, ...);
0688
0689 #define mpz_clrbit __gmpz_clrbit
0690 __GMP_DECLSPEC void mpz_clrbit (mpz_ptr, mp_bitcnt_t);
0691
0692 #define mpz_cmp __gmpz_cmp
0693 __GMP_DECLSPEC int mpz_cmp (mpz_srcptr, mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0694
0695 #define mpz_cmp_d __gmpz_cmp_d
0696 __GMP_DECLSPEC int mpz_cmp_d (mpz_srcptr, double) __GMP_ATTRIBUTE_PURE;
0697
0698 #define _mpz_cmp_si __gmpz_cmp_si
0699 __GMP_DECLSPEC int _mpz_cmp_si (mpz_srcptr, signed long int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0700
0701 #define _mpz_cmp_ui __gmpz_cmp_ui
0702 __GMP_DECLSPEC int _mpz_cmp_ui (mpz_srcptr, unsigned long int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0703
0704 #define mpz_cmpabs __gmpz_cmpabs
0705 __GMP_DECLSPEC int mpz_cmpabs (mpz_srcptr, mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0706
0707 #define mpz_cmpabs_d __gmpz_cmpabs_d
0708 __GMP_DECLSPEC int mpz_cmpabs_d (mpz_srcptr, double) __GMP_ATTRIBUTE_PURE;
0709
0710 #define mpz_cmpabs_ui __gmpz_cmpabs_ui
0711 __GMP_DECLSPEC int mpz_cmpabs_ui (mpz_srcptr, unsigned long int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0712
0713 #define mpz_com __gmpz_com
0714 __GMP_DECLSPEC void mpz_com (mpz_ptr, mpz_srcptr);
0715
0716 #define mpz_combit __gmpz_combit
0717 __GMP_DECLSPEC void mpz_combit (mpz_ptr, mp_bitcnt_t);
0718
0719 #define mpz_congruent_p __gmpz_congruent_p
0720 __GMP_DECLSPEC int mpz_congruent_p (mpz_srcptr, mpz_srcptr, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
0721
0722 #define mpz_congruent_2exp_p __gmpz_congruent_2exp_p
0723 __GMP_DECLSPEC int mpz_congruent_2exp_p (mpz_srcptr, mpz_srcptr, mp_bitcnt_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0724
0725 #define mpz_congruent_ui_p __gmpz_congruent_ui_p
0726 __GMP_DECLSPEC int mpz_congruent_ui_p (mpz_srcptr, unsigned long, unsigned long) __GMP_ATTRIBUTE_PURE;
0727
0728 #define mpz_divexact __gmpz_divexact
0729 __GMP_DECLSPEC void mpz_divexact (mpz_ptr, mpz_srcptr, mpz_srcptr);
0730
0731 #define mpz_divexact_ui __gmpz_divexact_ui
0732 __GMP_DECLSPEC void mpz_divexact_ui (mpz_ptr, mpz_srcptr, unsigned long);
0733
0734 #define mpz_divisible_p __gmpz_divisible_p
0735 __GMP_DECLSPEC int mpz_divisible_p (mpz_srcptr, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
0736
0737 #define mpz_divisible_ui_p __gmpz_divisible_ui_p
0738 __GMP_DECLSPEC int mpz_divisible_ui_p (mpz_srcptr, unsigned long) __GMP_ATTRIBUTE_PURE;
0739
0740 #define mpz_divisible_2exp_p __gmpz_divisible_2exp_p
0741 __GMP_DECLSPEC int mpz_divisible_2exp_p (mpz_srcptr, mp_bitcnt_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0742
0743 #define mpz_dump __gmpz_dump
0744 __GMP_DECLSPEC void mpz_dump (mpz_srcptr);
0745
0746 #define mpz_export __gmpz_export
0747 __GMP_DECLSPEC void *mpz_export (void *, size_t *, int, size_t, int, size_t, mpz_srcptr);
0748
0749 #define mpz_fac_ui __gmpz_fac_ui
0750 __GMP_DECLSPEC void mpz_fac_ui (mpz_ptr, unsigned long int);
0751
0752 #define mpz_2fac_ui __gmpz_2fac_ui
0753 __GMP_DECLSPEC void mpz_2fac_ui (mpz_ptr, unsigned long int);
0754
0755 #define mpz_mfac_uiui __gmpz_mfac_uiui
0756 __GMP_DECLSPEC void mpz_mfac_uiui (mpz_ptr, unsigned long int, unsigned long int);
0757
0758 #define mpz_primorial_ui __gmpz_primorial_ui
0759 __GMP_DECLSPEC void mpz_primorial_ui (mpz_ptr, unsigned long int);
0760
0761 #define mpz_fdiv_q __gmpz_fdiv_q
0762 __GMP_DECLSPEC void mpz_fdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
0763
0764 #define mpz_fdiv_q_2exp __gmpz_fdiv_q_2exp
0765 __GMP_DECLSPEC void mpz_fdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
0766
0767 #define mpz_fdiv_q_ui __gmpz_fdiv_q_ui
0768 __GMP_DECLSPEC unsigned long int mpz_fdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);
0769
0770 #define mpz_fdiv_qr __gmpz_fdiv_qr
0771 __GMP_DECLSPEC void mpz_fdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
0772
0773 #define mpz_fdiv_qr_ui __gmpz_fdiv_qr_ui
0774 __GMP_DECLSPEC unsigned long int mpz_fdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
0775
0776 #define mpz_fdiv_r __gmpz_fdiv_r
0777 __GMP_DECLSPEC void mpz_fdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
0778
0779 #define mpz_fdiv_r_2exp __gmpz_fdiv_r_2exp
0780 __GMP_DECLSPEC void mpz_fdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
0781
0782 #define mpz_fdiv_r_ui __gmpz_fdiv_r_ui
0783 __GMP_DECLSPEC unsigned long int mpz_fdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);
0784
0785 #define mpz_fdiv_ui __gmpz_fdiv_ui
0786 __GMP_DECLSPEC unsigned long int mpz_fdiv_ui (mpz_srcptr, unsigned long int) __GMP_ATTRIBUTE_PURE;
0787
0788 #define mpz_fib_ui __gmpz_fib_ui
0789 __GMP_DECLSPEC void mpz_fib_ui (mpz_ptr, unsigned long int);
0790
0791 #define mpz_fib2_ui __gmpz_fib2_ui
0792 __GMP_DECLSPEC void mpz_fib2_ui (mpz_ptr, mpz_ptr, unsigned long int);
0793
0794 #define mpz_fits_sint_p __gmpz_fits_sint_p
0795 __GMP_DECLSPEC int mpz_fits_sint_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0796
0797 #define mpz_fits_slong_p __gmpz_fits_slong_p
0798 __GMP_DECLSPEC int mpz_fits_slong_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0799
0800 #define mpz_fits_sshort_p __gmpz_fits_sshort_p
0801 __GMP_DECLSPEC int mpz_fits_sshort_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0802
0803 #define mpz_fits_uint_p __gmpz_fits_uint_p
0804 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_fits_uint_p)
0805 __GMP_DECLSPEC int mpz_fits_uint_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0806 #endif
0807
0808 #define mpz_fits_ulong_p __gmpz_fits_ulong_p
0809 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_fits_ulong_p)
0810 __GMP_DECLSPEC int mpz_fits_ulong_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0811 #endif
0812
0813 #define mpz_fits_ushort_p __gmpz_fits_ushort_p
0814 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_fits_ushort_p)
0815 __GMP_DECLSPEC int mpz_fits_ushort_p (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0816 #endif
0817
0818 #define mpz_gcd __gmpz_gcd
0819 __GMP_DECLSPEC void mpz_gcd (mpz_ptr, mpz_srcptr, mpz_srcptr);
0820
0821 #define mpz_gcd_ui __gmpz_gcd_ui
0822 __GMP_DECLSPEC unsigned long int mpz_gcd_ui (mpz_ptr, mpz_srcptr, unsigned long int);
0823
0824 #define mpz_gcdext __gmpz_gcdext
0825 __GMP_DECLSPEC void mpz_gcdext (mpz_ptr, mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
0826
0827 #define mpz_get_d __gmpz_get_d
0828 __GMP_DECLSPEC double mpz_get_d (mpz_srcptr) __GMP_ATTRIBUTE_PURE;
0829
0830 #define mpz_get_d_2exp __gmpz_get_d_2exp
0831 __GMP_DECLSPEC double mpz_get_d_2exp (signed long int *, mpz_srcptr);
0832
0833 #define mpz_get_si __gmpz_get_si
0834 __GMP_DECLSPEC long int mpz_get_si (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0835
0836 #define mpz_get_str __gmpz_get_str
0837 __GMP_DECLSPEC char *mpz_get_str (char *, int, mpz_srcptr);
0838
0839 #define mpz_get_ui __gmpz_get_ui
0840 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_get_ui)
0841 __GMP_DECLSPEC unsigned long int mpz_get_ui (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0842 #endif
0843
0844 #define mpz_getlimbn __gmpz_getlimbn
0845 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_getlimbn)
0846 __GMP_DECLSPEC mp_limb_t mpz_getlimbn (mpz_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0847 #endif
0848
0849 #define mpz_hamdist __gmpz_hamdist
0850 __GMP_DECLSPEC mp_bitcnt_t mpz_hamdist (mpz_srcptr, mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0851
0852 #define mpz_import __gmpz_import
0853 __GMP_DECLSPEC void mpz_import (mpz_ptr, size_t, int, size_t, int, size_t, const void *);
0854
0855 #define mpz_init __gmpz_init
0856 __GMP_DECLSPEC void mpz_init (mpz_ptr) __GMP_NOTHROW;
0857
0858 #define mpz_init2 __gmpz_init2
0859 __GMP_DECLSPEC void mpz_init2 (mpz_ptr, mp_bitcnt_t);
0860
0861 #define mpz_inits __gmpz_inits
0862 __GMP_DECLSPEC void mpz_inits (mpz_ptr, ...) __GMP_NOTHROW;
0863
0864 #define mpz_init_set __gmpz_init_set
0865 __GMP_DECLSPEC void mpz_init_set (mpz_ptr, mpz_srcptr);
0866
0867 #define mpz_init_set_d __gmpz_init_set_d
0868 __GMP_DECLSPEC void mpz_init_set_d (mpz_ptr, double);
0869
0870 #define mpz_init_set_si __gmpz_init_set_si
0871 __GMP_DECLSPEC void mpz_init_set_si (mpz_ptr, signed long int);
0872
0873 #define mpz_init_set_str __gmpz_init_set_str
0874 __GMP_DECLSPEC int mpz_init_set_str (mpz_ptr, const char *, int);
0875
0876 #define mpz_init_set_ui __gmpz_init_set_ui
0877 __GMP_DECLSPEC void mpz_init_set_ui (mpz_ptr, unsigned long int);
0878
0879 #define mpz_inp_raw __gmpz_inp_raw
0880 #ifdef _GMP_H_HAVE_FILE
0881 __GMP_DECLSPEC size_t mpz_inp_raw (mpz_ptr, FILE *);
0882 #endif
0883
0884 #define mpz_inp_str __gmpz_inp_str
0885 #ifdef _GMP_H_HAVE_FILE
0886 __GMP_DECLSPEC size_t mpz_inp_str (mpz_ptr, FILE *, int);
0887 #endif
0888
0889 #define mpz_invert __gmpz_invert
0890 __GMP_DECLSPEC int mpz_invert (mpz_ptr, mpz_srcptr, mpz_srcptr);
0891
0892 #define mpz_ior __gmpz_ior
0893 __GMP_DECLSPEC void mpz_ior (mpz_ptr, mpz_srcptr, mpz_srcptr);
0894
0895 #define mpz_jacobi __gmpz_jacobi
0896 __GMP_DECLSPEC int mpz_jacobi (mpz_srcptr, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
0897
0898 #define mpz_kronecker mpz_jacobi
0899
0900 #define mpz_kronecker_si __gmpz_kronecker_si
0901 __GMP_DECLSPEC int mpz_kronecker_si (mpz_srcptr, long) __GMP_ATTRIBUTE_PURE;
0902
0903 #define mpz_kronecker_ui __gmpz_kronecker_ui
0904 __GMP_DECLSPEC int mpz_kronecker_ui (mpz_srcptr, unsigned long) __GMP_ATTRIBUTE_PURE;
0905
0906 #define mpz_si_kronecker __gmpz_si_kronecker
0907 __GMP_DECLSPEC int mpz_si_kronecker (long, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
0908
0909 #define mpz_ui_kronecker __gmpz_ui_kronecker
0910 __GMP_DECLSPEC int mpz_ui_kronecker (unsigned long, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
0911
0912 #define mpz_lcm __gmpz_lcm
0913 __GMP_DECLSPEC void mpz_lcm (mpz_ptr, mpz_srcptr, mpz_srcptr);
0914
0915 #define mpz_lcm_ui __gmpz_lcm_ui
0916 __GMP_DECLSPEC void mpz_lcm_ui (mpz_ptr, mpz_srcptr, unsigned long);
0917
0918 #define mpz_legendre mpz_jacobi
0919
0920 #define mpz_lucnum_ui __gmpz_lucnum_ui
0921 __GMP_DECLSPEC void mpz_lucnum_ui (mpz_ptr, unsigned long int);
0922
0923 #define mpz_lucnum2_ui __gmpz_lucnum2_ui
0924 __GMP_DECLSPEC void mpz_lucnum2_ui (mpz_ptr, mpz_ptr, unsigned long int);
0925
0926 #define mpz_millerrabin __gmpz_millerrabin
0927 __GMP_DECLSPEC int mpz_millerrabin (mpz_srcptr, int) __GMP_ATTRIBUTE_PURE;
0928
0929 #define mpz_mod __gmpz_mod
0930 __GMP_DECLSPEC void mpz_mod (mpz_ptr, mpz_srcptr, mpz_srcptr);
0931
0932 #define mpz_mod_ui mpz_fdiv_r_ui
0933
0934 #define mpz_mul __gmpz_mul
0935 __GMP_DECLSPEC void mpz_mul (mpz_ptr, mpz_srcptr, mpz_srcptr);
0936
0937 #define mpz_mul_2exp __gmpz_mul_2exp
0938 __GMP_DECLSPEC void mpz_mul_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
0939
0940 #define mpz_mul_si __gmpz_mul_si
0941 __GMP_DECLSPEC void mpz_mul_si (mpz_ptr, mpz_srcptr, long int);
0942
0943 #define mpz_mul_ui __gmpz_mul_ui
0944 __GMP_DECLSPEC void mpz_mul_ui (mpz_ptr, mpz_srcptr, unsigned long int);
0945
0946 #define mpz_neg __gmpz_neg
0947 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_neg)
0948 __GMP_DECLSPEC void mpz_neg (mpz_ptr, mpz_srcptr);
0949 #endif
0950
0951 #define mpz_nextprime __gmpz_nextprime
0952 __GMP_DECLSPEC void mpz_nextprime (mpz_ptr, mpz_srcptr);
0953
0954 #define mpz_prevprime __gmpz_prevprime
0955 __GMP_DECLSPEC int mpz_prevprime (mpz_ptr, mpz_srcptr);
0956
0957 #define mpz_out_raw __gmpz_out_raw
0958 #ifdef _GMP_H_HAVE_FILE
0959 __GMP_DECLSPEC size_t mpz_out_raw (FILE *, mpz_srcptr);
0960 #endif
0961
0962 #define mpz_out_str __gmpz_out_str
0963 #ifdef _GMP_H_HAVE_FILE
0964 __GMP_DECLSPEC size_t mpz_out_str (FILE *, int, mpz_srcptr);
0965 #endif
0966
0967 #define mpz_perfect_power_p __gmpz_perfect_power_p
0968 __GMP_DECLSPEC int mpz_perfect_power_p (mpz_srcptr) __GMP_ATTRIBUTE_PURE;
0969
0970 #define mpz_perfect_square_p __gmpz_perfect_square_p
0971 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_perfect_square_p)
0972 __GMP_DECLSPEC int mpz_perfect_square_p (mpz_srcptr) __GMP_ATTRIBUTE_PURE;
0973 #endif
0974
0975 #define mpz_popcount __gmpz_popcount
0976 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_popcount)
0977 __GMP_DECLSPEC mp_bitcnt_t mpz_popcount (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
0978 #endif
0979
0980 #define mpz_pow_ui __gmpz_pow_ui
0981 __GMP_DECLSPEC void mpz_pow_ui (mpz_ptr, mpz_srcptr, unsigned long int);
0982
0983 #define mpz_powm __gmpz_powm
0984 __GMP_DECLSPEC void mpz_powm (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr);
0985
0986 #define mpz_powm_sec __gmpz_powm_sec
0987 __GMP_DECLSPEC void mpz_powm_sec (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr);
0988
0989 #define mpz_powm_ui __gmpz_powm_ui
0990 __GMP_DECLSPEC void mpz_powm_ui (mpz_ptr, mpz_srcptr, unsigned long int, mpz_srcptr);
0991
0992 #define mpz_probab_prime_p __gmpz_probab_prime_p
0993 __GMP_DECLSPEC int mpz_probab_prime_p (mpz_srcptr, int) __GMP_ATTRIBUTE_PURE;
0994
0995 #define mpz_random __gmpz_random
0996 __GMP_DECLSPEC void mpz_random (mpz_ptr, mp_size_t);
0997
0998 #define mpz_random2 __gmpz_random2
0999 __GMP_DECLSPEC void mpz_random2 (mpz_ptr, mp_size_t);
1000
1001 #define mpz_realloc2 __gmpz_realloc2
1002 __GMP_DECLSPEC void mpz_realloc2 (mpz_ptr, mp_bitcnt_t);
1003
1004 #define mpz_remove __gmpz_remove
1005 __GMP_DECLSPEC mp_bitcnt_t mpz_remove (mpz_ptr, mpz_srcptr, mpz_srcptr);
1006
1007 #define mpz_root __gmpz_root
1008 __GMP_DECLSPEC int mpz_root (mpz_ptr, mpz_srcptr, unsigned long int);
1009
1010 #define mpz_rootrem __gmpz_rootrem
1011 __GMP_DECLSPEC void mpz_rootrem (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
1012
1013 #define mpz_rrandomb __gmpz_rrandomb
1014 __GMP_DECLSPEC void mpz_rrandomb (mpz_ptr, gmp_randstate_ptr, mp_bitcnt_t);
1015
1016 #define mpz_scan0 __gmpz_scan0
1017 __GMP_DECLSPEC mp_bitcnt_t mpz_scan0 (mpz_srcptr, mp_bitcnt_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1018
1019 #define mpz_scan1 __gmpz_scan1
1020 __GMP_DECLSPEC mp_bitcnt_t mpz_scan1 (mpz_srcptr, mp_bitcnt_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1021
1022 #define mpz_set __gmpz_set
1023 __GMP_DECLSPEC void mpz_set (mpz_ptr, mpz_srcptr);
1024
1025 #define mpz_set_d __gmpz_set_d
1026 __GMP_DECLSPEC void mpz_set_d (mpz_ptr, double);
1027
1028 #define mpz_set_f __gmpz_set_f
1029 __GMP_DECLSPEC void mpz_set_f (mpz_ptr, mpf_srcptr);
1030
1031 #define mpz_set_q __gmpz_set_q
1032 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_set_q)
1033 __GMP_DECLSPEC void mpz_set_q (mpz_ptr, mpq_srcptr);
1034 #endif
1035
1036 #define mpz_set_si __gmpz_set_si
1037 __GMP_DECLSPEC void mpz_set_si (mpz_ptr, signed long int);
1038
1039 #define mpz_set_str __gmpz_set_str
1040 __GMP_DECLSPEC int mpz_set_str (mpz_ptr, const char *, int);
1041
1042 #define mpz_set_ui __gmpz_set_ui
1043 __GMP_DECLSPEC void mpz_set_ui (mpz_ptr, unsigned long int);
1044
1045 #define mpz_setbit __gmpz_setbit
1046 __GMP_DECLSPEC void mpz_setbit (mpz_ptr, mp_bitcnt_t);
1047
1048 #define mpz_size __gmpz_size
1049 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpz_size)
1050 __GMP_DECLSPEC size_t mpz_size (mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1051 #endif
1052
1053 #define mpz_sizeinbase __gmpz_sizeinbase
1054 __GMP_DECLSPEC size_t mpz_sizeinbase (mpz_srcptr, int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1055
1056 #define mpz_sqrt __gmpz_sqrt
1057 __GMP_DECLSPEC void mpz_sqrt (mpz_ptr, mpz_srcptr);
1058
1059 #define mpz_sqrtrem __gmpz_sqrtrem
1060 __GMP_DECLSPEC void mpz_sqrtrem (mpz_ptr, mpz_ptr, mpz_srcptr);
1061
1062 #define mpz_sub __gmpz_sub
1063 __GMP_DECLSPEC void mpz_sub (mpz_ptr, mpz_srcptr, mpz_srcptr);
1064
1065 #define mpz_sub_ui __gmpz_sub_ui
1066 __GMP_DECLSPEC void mpz_sub_ui (mpz_ptr, mpz_srcptr, unsigned long int);
1067
1068 #define mpz_ui_sub __gmpz_ui_sub
1069 __GMP_DECLSPEC void mpz_ui_sub (mpz_ptr, unsigned long int, mpz_srcptr);
1070
1071 #define mpz_submul __gmpz_submul
1072 __GMP_DECLSPEC void mpz_submul (mpz_ptr, mpz_srcptr, mpz_srcptr);
1073
1074 #define mpz_submul_ui __gmpz_submul_ui
1075 __GMP_DECLSPEC void mpz_submul_ui (mpz_ptr, mpz_srcptr, unsigned long int);
1076
1077 #define mpz_swap __gmpz_swap
1078 __GMP_DECLSPEC void mpz_swap (mpz_ptr, mpz_ptr) __GMP_NOTHROW;
1079
1080 #define mpz_tdiv_ui __gmpz_tdiv_ui
1081 __GMP_DECLSPEC unsigned long int mpz_tdiv_ui (mpz_srcptr, unsigned long int) __GMP_ATTRIBUTE_PURE;
1082
1083 #define mpz_tdiv_q __gmpz_tdiv_q
1084 __GMP_DECLSPEC void mpz_tdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr);
1085
1086 #define mpz_tdiv_q_2exp __gmpz_tdiv_q_2exp
1087 __GMP_DECLSPEC void mpz_tdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
1088
1089 #define mpz_tdiv_q_ui __gmpz_tdiv_q_ui
1090 __GMP_DECLSPEC unsigned long int mpz_tdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int);
1091
1092 #define mpz_tdiv_qr __gmpz_tdiv_qr
1093 __GMP_DECLSPEC void mpz_tdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
1094
1095 #define mpz_tdiv_qr_ui __gmpz_tdiv_qr_ui
1096 __GMP_DECLSPEC unsigned long int mpz_tdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int);
1097
1098 #define mpz_tdiv_r __gmpz_tdiv_r
1099 __GMP_DECLSPEC void mpz_tdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr);
1100
1101 #define mpz_tdiv_r_2exp __gmpz_tdiv_r_2exp
1102 __GMP_DECLSPEC void mpz_tdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t);
1103
1104 #define mpz_tdiv_r_ui __gmpz_tdiv_r_ui
1105 __GMP_DECLSPEC unsigned long int mpz_tdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int);
1106
1107 #define mpz_tstbit __gmpz_tstbit
1108 __GMP_DECLSPEC int mpz_tstbit (mpz_srcptr, mp_bitcnt_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1109
1110 #define mpz_ui_pow_ui __gmpz_ui_pow_ui
1111 __GMP_DECLSPEC void mpz_ui_pow_ui (mpz_ptr, unsigned long int, unsigned long int);
1112
1113 #define mpz_urandomb __gmpz_urandomb
1114 __GMP_DECLSPEC void mpz_urandomb (mpz_ptr, gmp_randstate_ptr, mp_bitcnt_t);
1115
1116 #define mpz_urandomm __gmpz_urandomm
1117 __GMP_DECLSPEC void mpz_urandomm (mpz_ptr, gmp_randstate_ptr, mpz_srcptr);
1118
1119 #define mpz_xor __gmpz_xor
1120 #define mpz_eor __gmpz_xor
1121 __GMP_DECLSPEC void mpz_xor (mpz_ptr, mpz_srcptr, mpz_srcptr);
1122
1123 #define mpz_limbs_read __gmpz_limbs_read
1124 __GMP_DECLSPEC mp_srcptr mpz_limbs_read (mpz_srcptr);
1125
1126 #define mpz_limbs_write __gmpz_limbs_write
1127 __GMP_DECLSPEC mp_ptr mpz_limbs_write (mpz_ptr, mp_size_t);
1128
1129 #define mpz_limbs_modify __gmpz_limbs_modify
1130 __GMP_DECLSPEC mp_ptr mpz_limbs_modify (mpz_ptr, mp_size_t);
1131
1132 #define mpz_limbs_finish __gmpz_limbs_finish
1133 __GMP_DECLSPEC void mpz_limbs_finish (mpz_ptr, mp_size_t);
1134
1135 #define mpz_roinit_n __gmpz_roinit_n
1136 __GMP_DECLSPEC mpz_srcptr mpz_roinit_n (mpz_ptr, mp_srcptr, mp_size_t);
1137
1138 #define MPZ_ROINIT_N(xp, xs) {{0, (xs),(xp) }}
1139
1140
1141
1142 #define mpq_abs __gmpq_abs
1143 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpq_abs)
1144 __GMP_DECLSPEC void mpq_abs (mpq_ptr, mpq_srcptr);
1145 #endif
1146
1147 #define mpq_add __gmpq_add
1148 __GMP_DECLSPEC void mpq_add (mpq_ptr, mpq_srcptr, mpq_srcptr);
1149
1150 #define mpq_canonicalize __gmpq_canonicalize
1151 __GMP_DECLSPEC void mpq_canonicalize (mpq_ptr);
1152
1153 #define mpq_clear __gmpq_clear
1154 __GMP_DECLSPEC void mpq_clear (mpq_ptr);
1155
1156 #define mpq_clears __gmpq_clears
1157 __GMP_DECLSPEC void mpq_clears (mpq_ptr, ...);
1158
1159 #define mpq_cmp __gmpq_cmp
1160 __GMP_DECLSPEC int mpq_cmp (mpq_srcptr, mpq_srcptr) __GMP_ATTRIBUTE_PURE;
1161
1162 #define _mpq_cmp_si __gmpq_cmp_si
1163 __GMP_DECLSPEC int _mpq_cmp_si (mpq_srcptr, long, unsigned long) __GMP_ATTRIBUTE_PURE;
1164
1165 #define _mpq_cmp_ui __gmpq_cmp_ui
1166 __GMP_DECLSPEC int _mpq_cmp_ui (mpq_srcptr, unsigned long int, unsigned long int) __GMP_ATTRIBUTE_PURE;
1167
1168 #define mpq_cmp_z __gmpq_cmp_z
1169 __GMP_DECLSPEC int mpq_cmp_z (mpq_srcptr, mpz_srcptr) __GMP_ATTRIBUTE_PURE;
1170
1171 #define mpq_div __gmpq_div
1172 __GMP_DECLSPEC void mpq_div (mpq_ptr, mpq_srcptr, mpq_srcptr);
1173
1174 #define mpq_div_2exp __gmpq_div_2exp
1175 __GMP_DECLSPEC void mpq_div_2exp (mpq_ptr, mpq_srcptr, mp_bitcnt_t);
1176
1177 #define mpq_equal __gmpq_equal
1178 __GMP_DECLSPEC int mpq_equal (mpq_srcptr, mpq_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1179
1180 #define mpq_get_num __gmpq_get_num
1181 __GMP_DECLSPEC void mpq_get_num (mpz_ptr, mpq_srcptr);
1182
1183 #define mpq_get_den __gmpq_get_den
1184 __GMP_DECLSPEC void mpq_get_den (mpz_ptr, mpq_srcptr);
1185
1186 #define mpq_get_d __gmpq_get_d
1187 __GMP_DECLSPEC double mpq_get_d (mpq_srcptr) __GMP_ATTRIBUTE_PURE;
1188
1189 #define mpq_get_str __gmpq_get_str
1190 __GMP_DECLSPEC char *mpq_get_str (char *, int, mpq_srcptr);
1191
1192 #define mpq_init __gmpq_init
1193 __GMP_DECLSPEC void mpq_init (mpq_ptr);
1194
1195 #define mpq_inits __gmpq_inits
1196 __GMP_DECLSPEC void mpq_inits (mpq_ptr, ...);
1197
1198 #define mpq_inp_str __gmpq_inp_str
1199 #ifdef _GMP_H_HAVE_FILE
1200 __GMP_DECLSPEC size_t mpq_inp_str (mpq_ptr, FILE *, int);
1201 #endif
1202
1203 #define mpq_inv __gmpq_inv
1204 __GMP_DECLSPEC void mpq_inv (mpq_ptr, mpq_srcptr);
1205
1206 #define mpq_mul __gmpq_mul
1207 __GMP_DECLSPEC void mpq_mul (mpq_ptr, mpq_srcptr, mpq_srcptr);
1208
1209 #define mpq_mul_2exp __gmpq_mul_2exp
1210 __GMP_DECLSPEC void mpq_mul_2exp (mpq_ptr, mpq_srcptr, mp_bitcnt_t);
1211
1212 #define mpq_neg __gmpq_neg
1213 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpq_neg)
1214 __GMP_DECLSPEC void mpq_neg (mpq_ptr, mpq_srcptr);
1215 #endif
1216
1217 #define mpq_out_str __gmpq_out_str
1218 #ifdef _GMP_H_HAVE_FILE
1219 __GMP_DECLSPEC size_t mpq_out_str (FILE *, int, mpq_srcptr);
1220 #endif
1221
1222 #define mpq_set __gmpq_set
1223 __GMP_DECLSPEC void mpq_set (mpq_ptr, mpq_srcptr);
1224
1225 #define mpq_set_d __gmpq_set_d
1226 __GMP_DECLSPEC void mpq_set_d (mpq_ptr, double);
1227
1228 #define mpq_set_den __gmpq_set_den
1229 __GMP_DECLSPEC void mpq_set_den (mpq_ptr, mpz_srcptr);
1230
1231 #define mpq_set_f __gmpq_set_f
1232 __GMP_DECLSPEC void mpq_set_f (mpq_ptr, mpf_srcptr);
1233
1234 #define mpq_set_num __gmpq_set_num
1235 __GMP_DECLSPEC void mpq_set_num (mpq_ptr, mpz_srcptr);
1236
1237 #define mpq_set_si __gmpq_set_si
1238 __GMP_DECLSPEC void mpq_set_si (mpq_ptr, signed long int, unsigned long int);
1239
1240 #define mpq_set_str __gmpq_set_str
1241 __GMP_DECLSPEC int mpq_set_str (mpq_ptr, const char *, int);
1242
1243 #define mpq_set_ui __gmpq_set_ui
1244 __GMP_DECLSPEC void mpq_set_ui (mpq_ptr, unsigned long int, unsigned long int);
1245
1246 #define mpq_set_z __gmpq_set_z
1247 __GMP_DECLSPEC void mpq_set_z (mpq_ptr, mpz_srcptr);
1248
1249 #define mpq_sub __gmpq_sub
1250 __GMP_DECLSPEC void mpq_sub (mpq_ptr, mpq_srcptr, mpq_srcptr);
1251
1252 #define mpq_swap __gmpq_swap
1253 __GMP_DECLSPEC void mpq_swap (mpq_ptr, mpq_ptr) __GMP_NOTHROW;
1254
1255
1256
1257
1258 #define mpf_abs __gmpf_abs
1259 __GMP_DECLSPEC void mpf_abs (mpf_ptr, mpf_srcptr);
1260
1261 #define mpf_add __gmpf_add
1262 __GMP_DECLSPEC void mpf_add (mpf_ptr, mpf_srcptr, mpf_srcptr);
1263
1264 #define mpf_add_ui __gmpf_add_ui
1265 __GMP_DECLSPEC void mpf_add_ui (mpf_ptr, mpf_srcptr, unsigned long int);
1266 #define mpf_ceil __gmpf_ceil
1267 __GMP_DECLSPEC void mpf_ceil (mpf_ptr, mpf_srcptr);
1268
1269 #define mpf_clear __gmpf_clear
1270 __GMP_DECLSPEC void mpf_clear (mpf_ptr);
1271
1272 #define mpf_clears __gmpf_clears
1273 __GMP_DECLSPEC void mpf_clears (mpf_ptr, ...);
1274
1275 #define mpf_cmp __gmpf_cmp
1276 __GMP_DECLSPEC int mpf_cmp (mpf_srcptr, mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1277
1278 #define mpf_cmp_z __gmpf_cmp_z
1279 __GMP_DECLSPEC int mpf_cmp_z (mpf_srcptr, mpz_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1280
1281 #define mpf_cmp_d __gmpf_cmp_d
1282 __GMP_DECLSPEC int mpf_cmp_d (mpf_srcptr, double) __GMP_ATTRIBUTE_PURE;
1283
1284 #define mpf_cmp_si __gmpf_cmp_si
1285 __GMP_DECLSPEC int mpf_cmp_si (mpf_srcptr, signed long int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1286
1287 #define mpf_cmp_ui __gmpf_cmp_ui
1288 __GMP_DECLSPEC int mpf_cmp_ui (mpf_srcptr, unsigned long int) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1289
1290 #define mpf_div __gmpf_div
1291 __GMP_DECLSPEC void mpf_div (mpf_ptr, mpf_srcptr, mpf_srcptr);
1292
1293 #define mpf_div_2exp __gmpf_div_2exp
1294 __GMP_DECLSPEC void mpf_div_2exp (mpf_ptr, mpf_srcptr, mp_bitcnt_t);
1295
1296 #define mpf_div_ui __gmpf_div_ui
1297 __GMP_DECLSPEC void mpf_div_ui (mpf_ptr, mpf_srcptr, unsigned long int);
1298
1299 #define mpf_dump __gmpf_dump
1300 __GMP_DECLSPEC void mpf_dump (mpf_srcptr);
1301
1302 #define mpf_eq __gmpf_eq
1303 __GMP_DECLSPEC int mpf_eq (mpf_srcptr, mpf_srcptr, mp_bitcnt_t) __GMP_ATTRIBUTE_PURE;
1304
1305 #define mpf_fits_sint_p __gmpf_fits_sint_p
1306 __GMP_DECLSPEC int mpf_fits_sint_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1307
1308 #define mpf_fits_slong_p __gmpf_fits_slong_p
1309 __GMP_DECLSPEC int mpf_fits_slong_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1310
1311 #define mpf_fits_sshort_p __gmpf_fits_sshort_p
1312 __GMP_DECLSPEC int mpf_fits_sshort_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1313
1314 #define mpf_fits_uint_p __gmpf_fits_uint_p
1315 __GMP_DECLSPEC int mpf_fits_uint_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1316
1317 #define mpf_fits_ulong_p __gmpf_fits_ulong_p
1318 __GMP_DECLSPEC int mpf_fits_ulong_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1319
1320 #define mpf_fits_ushort_p __gmpf_fits_ushort_p
1321 __GMP_DECLSPEC int mpf_fits_ushort_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1322
1323 #define mpf_floor __gmpf_floor
1324 __GMP_DECLSPEC void mpf_floor (mpf_ptr, mpf_srcptr);
1325
1326 #define mpf_get_d __gmpf_get_d
1327 __GMP_DECLSPEC double mpf_get_d (mpf_srcptr) __GMP_ATTRIBUTE_PURE;
1328
1329 #define mpf_get_d_2exp __gmpf_get_d_2exp
1330 __GMP_DECLSPEC double mpf_get_d_2exp (signed long int *, mpf_srcptr);
1331
1332 #define mpf_get_default_prec __gmpf_get_default_prec
1333 __GMP_DECLSPEC mp_bitcnt_t mpf_get_default_prec (void) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1334
1335 #define mpf_get_prec __gmpf_get_prec
1336 __GMP_DECLSPEC mp_bitcnt_t mpf_get_prec (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1337
1338 #define mpf_get_si __gmpf_get_si
1339 __GMP_DECLSPEC long mpf_get_si (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1340
1341 #define mpf_get_str __gmpf_get_str
1342 __GMP_DECLSPEC char *mpf_get_str (char *, mp_exp_t *, int, size_t, mpf_srcptr);
1343
1344 #define mpf_get_ui __gmpf_get_ui
1345 __GMP_DECLSPEC unsigned long mpf_get_ui (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1346
1347 #define mpf_init __gmpf_init
1348 __GMP_DECLSPEC void mpf_init (mpf_ptr);
1349
1350 #define mpf_init2 __gmpf_init2
1351 __GMP_DECLSPEC void mpf_init2 (mpf_ptr, mp_bitcnt_t);
1352
1353 #define mpf_inits __gmpf_inits
1354 __GMP_DECLSPEC void mpf_inits (mpf_ptr, ...);
1355
1356 #define mpf_init_set __gmpf_init_set
1357 __GMP_DECLSPEC void mpf_init_set (mpf_ptr, mpf_srcptr);
1358
1359 #define mpf_init_set_d __gmpf_init_set_d
1360 __GMP_DECLSPEC void mpf_init_set_d (mpf_ptr, double);
1361
1362 #define mpf_init_set_si __gmpf_init_set_si
1363 __GMP_DECLSPEC void mpf_init_set_si (mpf_ptr, signed long int);
1364
1365 #define mpf_init_set_str __gmpf_init_set_str
1366 __GMP_DECLSPEC int mpf_init_set_str (mpf_ptr, const char *, int);
1367
1368 #define mpf_init_set_ui __gmpf_init_set_ui
1369 __GMP_DECLSPEC void mpf_init_set_ui (mpf_ptr, unsigned long int);
1370
1371 #define mpf_inp_str __gmpf_inp_str
1372 #ifdef _GMP_H_HAVE_FILE
1373 __GMP_DECLSPEC size_t mpf_inp_str (mpf_ptr, FILE *, int);
1374 #endif
1375
1376 #define mpf_integer_p __gmpf_integer_p
1377 __GMP_DECLSPEC int mpf_integer_p (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1378
1379 #define mpf_mul __gmpf_mul
1380 __GMP_DECLSPEC void mpf_mul (mpf_ptr, mpf_srcptr, mpf_srcptr);
1381
1382 #define mpf_mul_2exp __gmpf_mul_2exp
1383 __GMP_DECLSPEC void mpf_mul_2exp (mpf_ptr, mpf_srcptr, mp_bitcnt_t);
1384
1385 #define mpf_mul_ui __gmpf_mul_ui
1386 __GMP_DECLSPEC void mpf_mul_ui (mpf_ptr, mpf_srcptr, unsigned long int);
1387
1388 #define mpf_neg __gmpf_neg
1389 __GMP_DECLSPEC void mpf_neg (mpf_ptr, mpf_srcptr);
1390
1391 #define mpf_out_str __gmpf_out_str
1392 #ifdef _GMP_H_HAVE_FILE
1393 __GMP_DECLSPEC size_t mpf_out_str (FILE *, int, size_t, mpf_srcptr);
1394 #endif
1395
1396 #define mpf_pow_ui __gmpf_pow_ui
1397 __GMP_DECLSPEC void mpf_pow_ui (mpf_ptr, mpf_srcptr, unsigned long int);
1398
1399 #define mpf_random2 __gmpf_random2
1400 __GMP_DECLSPEC void mpf_random2 (mpf_ptr, mp_size_t, mp_exp_t);
1401
1402 #define mpf_reldiff __gmpf_reldiff
1403 __GMP_DECLSPEC void mpf_reldiff (mpf_ptr, mpf_srcptr, mpf_srcptr);
1404
1405 #define mpf_set __gmpf_set
1406 __GMP_DECLSPEC void mpf_set (mpf_ptr, mpf_srcptr);
1407
1408 #define mpf_set_d __gmpf_set_d
1409 __GMP_DECLSPEC void mpf_set_d (mpf_ptr, double);
1410
1411 #define mpf_set_default_prec __gmpf_set_default_prec
1412 __GMP_DECLSPEC void mpf_set_default_prec (mp_bitcnt_t) __GMP_NOTHROW;
1413
1414 #define mpf_set_prec __gmpf_set_prec
1415 __GMP_DECLSPEC void mpf_set_prec (mpf_ptr, mp_bitcnt_t);
1416
1417 #define mpf_set_prec_raw __gmpf_set_prec_raw
1418 __GMP_DECLSPEC void mpf_set_prec_raw (mpf_ptr, mp_bitcnt_t) __GMP_NOTHROW;
1419
1420 #define mpf_set_q __gmpf_set_q
1421 __GMP_DECLSPEC void mpf_set_q (mpf_ptr, mpq_srcptr);
1422
1423 #define mpf_set_si __gmpf_set_si
1424 __GMP_DECLSPEC void mpf_set_si (mpf_ptr, signed long int);
1425
1426 #define mpf_set_str __gmpf_set_str
1427 __GMP_DECLSPEC int mpf_set_str (mpf_ptr, const char *, int);
1428
1429 #define mpf_set_ui __gmpf_set_ui
1430 __GMP_DECLSPEC void mpf_set_ui (mpf_ptr, unsigned long int);
1431
1432 #define mpf_set_z __gmpf_set_z
1433 __GMP_DECLSPEC void mpf_set_z (mpf_ptr, mpz_srcptr);
1434
1435 #define mpf_size __gmpf_size
1436 __GMP_DECLSPEC size_t mpf_size (mpf_srcptr) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1437
1438 #define mpf_sqrt __gmpf_sqrt
1439 __GMP_DECLSPEC void mpf_sqrt (mpf_ptr, mpf_srcptr);
1440
1441 #define mpf_sqrt_ui __gmpf_sqrt_ui
1442 __GMP_DECLSPEC void mpf_sqrt_ui (mpf_ptr, unsigned long int);
1443
1444 #define mpf_sub __gmpf_sub
1445 __GMP_DECLSPEC void mpf_sub (mpf_ptr, mpf_srcptr, mpf_srcptr);
1446
1447 #define mpf_sub_ui __gmpf_sub_ui
1448 __GMP_DECLSPEC void mpf_sub_ui (mpf_ptr, mpf_srcptr, unsigned long int);
1449
1450 #define mpf_swap __gmpf_swap
1451 __GMP_DECLSPEC void mpf_swap (mpf_ptr, mpf_ptr) __GMP_NOTHROW;
1452
1453 #define mpf_trunc __gmpf_trunc
1454 __GMP_DECLSPEC void mpf_trunc (mpf_ptr, mpf_srcptr);
1455
1456 #define mpf_ui_div __gmpf_ui_div
1457 __GMP_DECLSPEC void mpf_ui_div (mpf_ptr, unsigned long int, mpf_srcptr);
1458
1459 #define mpf_ui_sub __gmpf_ui_sub
1460 __GMP_DECLSPEC void mpf_ui_sub (mpf_ptr, unsigned long int, mpf_srcptr);
1461
1462 #define mpf_urandomb __gmpf_urandomb
1463 __GMP_DECLSPEC void mpf_urandomb (mpf_ptr, gmp_randstate_ptr, mp_bitcnt_t);
1464
1465
1466
1467
1468
1469
1470 #define mpn_add __MPN(add)
1471 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_add)
1472 __GMP_DECLSPEC mp_limb_t mpn_add (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
1473 #endif
1474
1475 #define mpn_add_1 __MPN(add_1)
1476 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_add_1)
1477 __GMP_DECLSPEC mp_limb_t mpn_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t) __GMP_NOTHROW;
1478 #endif
1479
1480 #define mpn_add_n __MPN(add_n)
1481 __GMP_DECLSPEC mp_limb_t mpn_add_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1482
1483 #define mpn_addmul_1 __MPN(addmul_1)
1484 __GMP_DECLSPEC mp_limb_t mpn_addmul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
1485
1486 #define mpn_cmp __MPN(cmp)
1487 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_cmp)
1488 __GMP_DECLSPEC int mpn_cmp (mp_srcptr, mp_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1489 #endif
1490
1491 #define mpn_zero_p __MPN(zero_p)
1492 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_zero_p)
1493 __GMP_DECLSPEC int mpn_zero_p (mp_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1494 #endif
1495
1496 #define mpn_divexact_1 __MPN(divexact_1)
1497 __GMP_DECLSPEC void mpn_divexact_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
1498
1499 #define mpn_divexact_by3(dst,src,size) \
1500 mpn_divexact_by3c (dst, src, size, __GMP_CAST (mp_limb_t, 0))
1501
1502 #define mpn_divexact_by3c __MPN(divexact_by3c)
1503 __GMP_DECLSPEC mp_limb_t mpn_divexact_by3c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
1504
1505 #define mpn_divmod_1(qp,np,nsize,dlimb) \
1506 mpn_divrem_1 (qp, __GMP_CAST (mp_size_t, 0), np, nsize, dlimb)
1507
1508 #define mpn_divrem __MPN(divrem)
1509 __GMP_DECLSPEC mp_limb_t mpn_divrem (mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr, mp_size_t);
1510
1511 #define mpn_divrem_1 __MPN(divrem_1)
1512 __GMP_DECLSPEC mp_limb_t mpn_divrem_1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
1513
1514 #define mpn_divrem_2 __MPN(divrem_2)
1515 __GMP_DECLSPEC mp_limb_t mpn_divrem_2 (mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr);
1516
1517 #define mpn_div_qr_1 __MPN(div_qr_1)
1518 __GMP_DECLSPEC mp_limb_t mpn_div_qr_1 (mp_ptr, mp_limb_t *, mp_srcptr, mp_size_t, mp_limb_t);
1519
1520 #define mpn_div_qr_2 __MPN(div_qr_2)
1521 __GMP_DECLSPEC mp_limb_t mpn_div_qr_2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
1522
1523 #define mpn_gcd __MPN(gcd)
1524 __GMP_DECLSPEC mp_size_t mpn_gcd (mp_ptr, mp_ptr, mp_size_t, mp_ptr, mp_size_t);
1525
1526 #define mpn_gcd_11 __MPN(gcd_11)
1527 __GMP_DECLSPEC mp_limb_t mpn_gcd_11 (mp_limb_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
1528
1529 #define mpn_gcd_1 __MPN(gcd_1)
1530 __GMP_DECLSPEC mp_limb_t mpn_gcd_1 (mp_srcptr, mp_size_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
1531
1532 #define mpn_gcdext_1 __MPN(gcdext_1)
1533 __GMP_DECLSPEC mp_limb_t mpn_gcdext_1 (mp_limb_signed_t *, mp_limb_signed_t *, mp_limb_t, mp_limb_t);
1534
1535 #define mpn_gcdext __MPN(gcdext)
1536 __GMP_DECLSPEC mp_size_t mpn_gcdext (mp_ptr, mp_ptr, mp_size_t *, mp_ptr, mp_size_t, mp_ptr, mp_size_t);
1537
1538 #define mpn_get_str __MPN(get_str)
1539 __GMP_DECLSPEC size_t mpn_get_str (unsigned char *, int, mp_ptr, mp_size_t);
1540
1541 #define mpn_hamdist __MPN(hamdist)
1542 __GMP_DECLSPEC mp_bitcnt_t mpn_hamdist (mp_srcptr, mp_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1543
1544 #define mpn_lshift __MPN(lshift)
1545 __GMP_DECLSPEC mp_limb_t mpn_lshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
1546
1547 #define mpn_mod_1 __MPN(mod_1)
1548 __GMP_DECLSPEC mp_limb_t mpn_mod_1 (mp_srcptr, mp_size_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
1549
1550 #define mpn_mul __MPN(mul)
1551 __GMP_DECLSPEC mp_limb_t mpn_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
1552
1553 #define mpn_mul_1 __MPN(mul_1)
1554 __GMP_DECLSPEC mp_limb_t mpn_mul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
1555
1556 #define mpn_mul_n __MPN(mul_n)
1557 __GMP_DECLSPEC void mpn_mul_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1558
1559 #define mpn_sqr __MPN(sqr)
1560 __GMP_DECLSPEC void mpn_sqr (mp_ptr, mp_srcptr, mp_size_t);
1561
1562 #define mpn_neg __MPN(neg)
1563 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_neg)
1564 __GMP_DECLSPEC mp_limb_t mpn_neg (mp_ptr, mp_srcptr, mp_size_t);
1565 #endif
1566
1567 #define mpn_com __MPN(com)
1568 __GMP_DECLSPEC void mpn_com (mp_ptr, mp_srcptr, mp_size_t);
1569
1570 #define mpn_perfect_square_p __MPN(perfect_square_p)
1571 __GMP_DECLSPEC int mpn_perfect_square_p (mp_srcptr, mp_size_t) __GMP_ATTRIBUTE_PURE;
1572
1573 #define mpn_perfect_power_p __MPN(perfect_power_p)
1574 __GMP_DECLSPEC int mpn_perfect_power_p (mp_srcptr, mp_size_t) __GMP_ATTRIBUTE_PURE;
1575
1576 #define mpn_popcount __MPN(popcount)
1577 __GMP_DECLSPEC mp_bitcnt_t mpn_popcount (mp_srcptr, mp_size_t) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE;
1578
1579 #define mpn_pow_1 __MPN(pow_1)
1580 __GMP_DECLSPEC mp_size_t mpn_pow_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
1581
1582
1583 #define mpn_preinv_mod_1 __MPN(preinv_mod_1)
1584 __GMP_DECLSPEC mp_limb_t mpn_preinv_mod_1 (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
1585
1586 #define mpn_random __MPN(random)
1587 __GMP_DECLSPEC void mpn_random (mp_ptr, mp_size_t);
1588
1589 #define mpn_random2 __MPN(random2)
1590 __GMP_DECLSPEC void mpn_random2 (mp_ptr, mp_size_t);
1591
1592 #define mpn_rshift __MPN(rshift)
1593 __GMP_DECLSPEC mp_limb_t mpn_rshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
1594
1595 #define mpn_scan0 __MPN(scan0)
1596 __GMP_DECLSPEC mp_bitcnt_t mpn_scan0 (mp_srcptr, mp_bitcnt_t) __GMP_ATTRIBUTE_PURE;
1597
1598 #define mpn_scan1 __MPN(scan1)
1599 __GMP_DECLSPEC mp_bitcnt_t mpn_scan1 (mp_srcptr, mp_bitcnt_t) __GMP_ATTRIBUTE_PURE;
1600
1601 #define mpn_set_str __MPN(set_str)
1602 __GMP_DECLSPEC mp_size_t mpn_set_str (mp_ptr, const unsigned char *, size_t, int);
1603
1604 #define mpn_sizeinbase __MPN(sizeinbase)
1605 __GMP_DECLSPEC size_t mpn_sizeinbase (mp_srcptr, mp_size_t, int);
1606
1607 #define mpn_sqrtrem __MPN(sqrtrem)
1608 __GMP_DECLSPEC mp_size_t mpn_sqrtrem (mp_ptr, mp_ptr, mp_srcptr, mp_size_t);
1609
1610 #define mpn_sub __MPN(sub)
1611 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_sub)
1612 __GMP_DECLSPEC mp_limb_t mpn_sub (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
1613 #endif
1614
1615 #define mpn_sub_1 __MPN(sub_1)
1616 #if __GMP_INLINE_PROTOTYPES || defined (__GMP_FORCE_mpn_sub_1)
1617 __GMP_DECLSPEC mp_limb_t mpn_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t) __GMP_NOTHROW;
1618 #endif
1619
1620 #define mpn_sub_n __MPN(sub_n)
1621 __GMP_DECLSPEC mp_limb_t mpn_sub_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1622
1623 #define mpn_submul_1 __MPN(submul_1)
1624 __GMP_DECLSPEC mp_limb_t mpn_submul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
1625
1626 #define mpn_tdiv_qr __MPN(tdiv_qr)
1627 __GMP_DECLSPEC void mpn_tdiv_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
1628
1629 #define mpn_and_n __MPN(and_n)
1630 __GMP_DECLSPEC void mpn_and_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1631 #define mpn_andn_n __MPN(andn_n)
1632 __GMP_DECLSPEC void mpn_andn_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1633 #define mpn_nand_n __MPN(nand_n)
1634 __GMP_DECLSPEC void mpn_nand_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1635 #define mpn_ior_n __MPN(ior_n)
1636 __GMP_DECLSPEC void mpn_ior_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1637 #define mpn_iorn_n __MPN(iorn_n)
1638 __GMP_DECLSPEC void mpn_iorn_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1639 #define mpn_nior_n __MPN(nior_n)
1640 __GMP_DECLSPEC void mpn_nior_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1641 #define mpn_xor_n __MPN(xor_n)
1642 __GMP_DECLSPEC void mpn_xor_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1643 #define mpn_xnor_n __MPN(xnor_n)
1644 __GMP_DECLSPEC void mpn_xnor_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1645
1646 #define mpn_copyi __MPN(copyi)
1647 __GMP_DECLSPEC void mpn_copyi (mp_ptr, mp_srcptr, mp_size_t);
1648 #define mpn_copyd __MPN(copyd)
1649 __GMP_DECLSPEC void mpn_copyd (mp_ptr, mp_srcptr, mp_size_t);
1650 #define mpn_zero __MPN(zero)
1651 __GMP_DECLSPEC void mpn_zero (mp_ptr, mp_size_t);
1652
1653 #define mpn_cnd_add_n __MPN(cnd_add_n)
1654 __GMP_DECLSPEC mp_limb_t mpn_cnd_add_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1655 #define mpn_cnd_sub_n __MPN(cnd_sub_n)
1656 __GMP_DECLSPEC mp_limb_t mpn_cnd_sub_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
1657
1658 #define mpn_sec_add_1 __MPN(sec_add_1)
1659 __GMP_DECLSPEC mp_limb_t mpn_sec_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
1660 #define mpn_sec_add_1_itch __MPN(sec_add_1_itch)
1661 __GMP_DECLSPEC mp_size_t mpn_sec_add_1_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
1662
1663 #define mpn_sec_sub_1 __MPN(sec_sub_1)
1664 __GMP_DECLSPEC mp_limb_t mpn_sec_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
1665 #define mpn_sec_sub_1_itch __MPN(sec_sub_1_itch)
1666 __GMP_DECLSPEC mp_size_t mpn_sec_sub_1_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
1667
1668 #define mpn_cnd_swap __MPN(cnd_swap)
1669 __GMP_DECLSPEC void mpn_cnd_swap (mp_limb_t, volatile mp_limb_t *, volatile mp_limb_t *, mp_size_t);
1670
1671 #define mpn_sec_mul __MPN(sec_mul)
1672 __GMP_DECLSPEC void mpn_sec_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
1673 #define mpn_sec_mul_itch __MPN(sec_mul_itch)
1674 __GMP_DECLSPEC mp_size_t mpn_sec_mul_itch (mp_size_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
1675
1676 #define mpn_sec_sqr __MPN(sec_sqr)
1677 __GMP_DECLSPEC void mpn_sec_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr);
1678 #define mpn_sec_sqr_itch __MPN(sec_sqr_itch)
1679 __GMP_DECLSPEC mp_size_t mpn_sec_sqr_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
1680
1681 #define mpn_sec_powm __MPN(sec_powm)
1682 __GMP_DECLSPEC void mpn_sec_powm (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_bitcnt_t, mp_srcptr, mp_size_t, mp_ptr);
1683 #define mpn_sec_powm_itch __MPN(sec_powm_itch)
1684 __GMP_DECLSPEC mp_size_t mpn_sec_powm_itch (mp_size_t, mp_bitcnt_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
1685
1686 #define mpn_sec_tabselect __MPN(sec_tabselect)
1687 __GMP_DECLSPEC void mpn_sec_tabselect (volatile mp_limb_t *, volatile const mp_limb_t *, mp_size_t, mp_size_t, mp_size_t);
1688
1689 #define mpn_sec_div_qr __MPN(sec_div_qr)
1690 __GMP_DECLSPEC mp_limb_t mpn_sec_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
1691 #define mpn_sec_div_qr_itch __MPN(sec_div_qr_itch)
1692 __GMP_DECLSPEC mp_size_t mpn_sec_div_qr_itch (mp_size_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
1693 #define mpn_sec_div_r __MPN(sec_div_r)
1694 __GMP_DECLSPEC void mpn_sec_div_r (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
1695 #define mpn_sec_div_r_itch __MPN(sec_div_r_itch)
1696 __GMP_DECLSPEC mp_size_t mpn_sec_div_r_itch (mp_size_t, mp_size_t) __GMP_ATTRIBUTE_PURE;
1697
1698 #define mpn_sec_invert __MPN(sec_invert)
1699 __GMP_DECLSPEC int mpn_sec_invert (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_bitcnt_t, mp_ptr);
1700 #define mpn_sec_invert_itch __MPN(sec_invert_itch)
1701 __GMP_DECLSPEC mp_size_t mpn_sec_invert_itch (mp_size_t) __GMP_ATTRIBUTE_PURE;
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720 #if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpz_abs)
1721 __GMP_EXTERN_INLINE void
1722 mpz_abs (mpz_ptr __gmp_w, mpz_srcptr __gmp_u)
1723 {
1724 if (__gmp_w != __gmp_u)
1725 mpz_set (__gmp_w, __gmp_u);
1726 __gmp_w->_mp_size = __GMP_ABS (__gmp_w->_mp_size);
1727 }
1728 #endif
1729
1730 #if GMP_NAIL_BITS == 0
1731 #define __GMPZ_FITS_UTYPE_P(z,maxval) \
1732 mp_size_t __gmp_n = z->_mp_size; \
1733 mp_ptr __gmp_p = z->_mp_d; \
1734 return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= maxval));
1735 #else
1736 #define __GMPZ_FITS_UTYPE_P(z,maxval) \
1737 mp_size_t __gmp_n = z->_mp_size; \
1738 mp_ptr __gmp_p = z->_mp_d; \
1739 return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= maxval) \
1740 || (__gmp_n == 2 && __gmp_p[1] <= ((mp_limb_t) maxval >> GMP_NUMB_BITS)));
1741 #endif
1742
1743 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_fits_uint_p)
1744 #if ! defined (__GMP_FORCE_mpz_fits_uint_p)
1745 __GMP_EXTERN_INLINE
1746 #endif
1747 int
1748 mpz_fits_uint_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
1749 {
1750 __GMPZ_FITS_UTYPE_P (__gmp_z, UINT_MAX);
1751 }
1752 #endif
1753
1754 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_fits_ulong_p)
1755 #if ! defined (__GMP_FORCE_mpz_fits_ulong_p)
1756 __GMP_EXTERN_INLINE
1757 #endif
1758 int
1759 mpz_fits_ulong_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
1760 {
1761 __GMPZ_FITS_UTYPE_P (__gmp_z, ULONG_MAX);
1762 }
1763 #endif
1764
1765 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_fits_ushort_p)
1766 #if ! defined (__GMP_FORCE_mpz_fits_ushort_p)
1767 __GMP_EXTERN_INLINE
1768 #endif
1769 int
1770 mpz_fits_ushort_p (mpz_srcptr __gmp_z) __GMP_NOTHROW
1771 {
1772 __GMPZ_FITS_UTYPE_P (__gmp_z, USHRT_MAX);
1773 }
1774 #endif
1775
1776 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_get_ui)
1777 #if ! defined (__GMP_FORCE_mpz_get_ui)
1778 __GMP_EXTERN_INLINE
1779 #endif
1780 unsigned long
1781 mpz_get_ui (mpz_srcptr __gmp_z) __GMP_NOTHROW
1782 {
1783 mp_ptr __gmp_p = __gmp_z->_mp_d;
1784 mp_size_t __gmp_n = __gmp_z->_mp_size;
1785 mp_limb_t __gmp_l = __gmp_p[0];
1786
1787
1788
1789
1790 #if GMP_NAIL_BITS == 0 || defined (_LONG_LONG_LIMB)
1791
1792 return (__gmp_n != 0 ? __gmp_l : 0);
1793 #else
1794
1795 __gmp_n = __GMP_ABS (__gmp_n);
1796 if (__gmp_n <= 1)
1797 return (__gmp_n != 0 ? __gmp_l : 0);
1798 else
1799 return __gmp_l + (__gmp_p[1] << GMP_NUMB_BITS);
1800 #endif
1801 }
1802 #endif
1803
1804 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_getlimbn)
1805 #if ! defined (__GMP_FORCE_mpz_getlimbn)
1806 __GMP_EXTERN_INLINE
1807 #endif
1808 mp_limb_t
1809 mpz_getlimbn (mpz_srcptr __gmp_z, mp_size_t __gmp_n) __GMP_NOTHROW
1810 {
1811 mp_limb_t __gmp_result = 0;
1812 if (__GMP_LIKELY (__gmp_n >= 0 && __gmp_n < __GMP_ABS (__gmp_z->_mp_size)))
1813 __gmp_result = __gmp_z->_mp_d[__gmp_n];
1814 return __gmp_result;
1815 }
1816 #endif
1817
1818 #if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpz_neg)
1819 __GMP_EXTERN_INLINE void
1820 mpz_neg (mpz_ptr __gmp_w, mpz_srcptr __gmp_u)
1821 {
1822 if (__gmp_w != __gmp_u)
1823 mpz_set (__gmp_w, __gmp_u);
1824 __gmp_w->_mp_size = - __gmp_w->_mp_size;
1825 }
1826 #endif
1827
1828 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_perfect_square_p)
1829 #if ! defined (__GMP_FORCE_mpz_perfect_square_p)
1830 __GMP_EXTERN_INLINE
1831 #endif
1832 int
1833 mpz_perfect_square_p (mpz_srcptr __gmp_a)
1834 {
1835 mp_size_t __gmp_asize;
1836 int __gmp_result;
1837
1838 __gmp_asize = __gmp_a->_mp_size;
1839 __gmp_result = (__gmp_asize >= 0);
1840 if (__GMP_LIKELY (__gmp_asize > 0))
1841 __gmp_result = mpn_perfect_square_p (__gmp_a->_mp_d, __gmp_asize);
1842 return __gmp_result;
1843 }
1844 #endif
1845
1846 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_popcount)
1847 #if ! defined (__GMP_FORCE_mpz_popcount)
1848 __GMP_EXTERN_INLINE
1849 #endif
1850 mp_bitcnt_t
1851 mpz_popcount (mpz_srcptr __gmp_u) __GMP_NOTHROW
1852 {
1853 mp_size_t __gmp_usize;
1854 mp_bitcnt_t __gmp_result;
1855
1856 __gmp_usize = __gmp_u->_mp_size;
1857 __gmp_result = (__gmp_usize < 0 ? ~ __GMP_CAST (mp_bitcnt_t, 0) : __GMP_CAST (mp_bitcnt_t, 0));
1858 if (__GMP_LIKELY (__gmp_usize > 0))
1859 __gmp_result = mpn_popcount (__gmp_u->_mp_d, __gmp_usize);
1860 return __gmp_result;
1861 }
1862 #endif
1863
1864 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_set_q)
1865 #if ! defined (__GMP_FORCE_mpz_set_q)
1866 __GMP_EXTERN_INLINE
1867 #endif
1868 void
1869 mpz_set_q (mpz_ptr __gmp_w, mpq_srcptr __gmp_u)
1870 {
1871 mpz_tdiv_q (__gmp_w, mpq_numref (__gmp_u), mpq_denref (__gmp_u));
1872 }
1873 #endif
1874
1875 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpz_size)
1876 #if ! defined (__GMP_FORCE_mpz_size)
1877 __GMP_EXTERN_INLINE
1878 #endif
1879 size_t
1880 mpz_size (mpz_srcptr __gmp_z) __GMP_NOTHROW
1881 {
1882 return __GMP_ABS (__gmp_z->_mp_size);
1883 }
1884 #endif
1885
1886
1887
1888
1889 #if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpq_abs)
1890 __GMP_EXTERN_INLINE void
1891 mpq_abs (mpq_ptr __gmp_w, mpq_srcptr __gmp_u)
1892 {
1893 if (__gmp_w != __gmp_u)
1894 mpq_set (__gmp_w, __gmp_u);
1895 __gmp_w->_mp_num._mp_size = __GMP_ABS (__gmp_w->_mp_num._mp_size);
1896 }
1897 #endif
1898
1899 #if defined (__GMP_EXTERN_INLINE) && ! defined (__GMP_FORCE_mpq_neg)
1900 __GMP_EXTERN_INLINE void
1901 mpq_neg (mpq_ptr __gmp_w, mpq_srcptr __gmp_u)
1902 {
1903 if (__gmp_w != __gmp_u)
1904 mpq_set (__gmp_w, __gmp_u);
1905 __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size;
1906 }
1907 #endif
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927 #define __GMPN_AORS(cout, wp, xp, xsize, yp, ysize, FUNCTION, TEST) \
1928 do { \
1929 mp_size_t __gmp_i; \
1930 mp_limb_t __gmp_x; \
1931 \
1932 \
1933 \
1934 \
1935 \
1936 \
1937 __gmp_i = (ysize); \
1938 if (__gmp_i != 0) \
1939 { \
1940 if (FUNCTION (wp, xp, yp, __gmp_i)) \
1941 { \
1942 do \
1943 { \
1944 if (__gmp_i >= (xsize)) \
1945 { \
1946 (cout) = 1; \
1947 goto __gmp_done; \
1948 } \
1949 __gmp_x = (xp)[__gmp_i]; \
1950 } \
1951 while (TEST); \
1952 } \
1953 } \
1954 if ((wp) != (xp)) \
1955 __GMPN_COPY_REST (wp, xp, xsize, __gmp_i); \
1956 (cout) = 0; \
1957 __gmp_done: \
1958 ; \
1959 } while (0)
1960
1961 #define __GMPN_ADD(cout, wp, xp, xsize, yp, ysize) \
1962 __GMPN_AORS (cout, wp, xp, xsize, yp, ysize, mpn_add_n, \
1963 (((wp)[__gmp_i++] = (__gmp_x + 1) & GMP_NUMB_MASK) == 0))
1964 #define __GMPN_SUB(cout, wp, xp, xsize, yp, ysize) \
1965 __GMPN_AORS (cout, wp, xp, xsize, yp, ysize, mpn_sub_n, \
1966 (((wp)[__gmp_i++] = (__gmp_x - 1) & GMP_NUMB_MASK), __gmp_x == 0))
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993 #if GMP_NAIL_BITS == 0
1994 #define __GMPN_AORS_1(cout, dst, src, n, v, OP, CB) \
1995 do { \
1996 mp_size_t __gmp_i; \
1997 mp_limb_t __gmp_x, __gmp_r; \
1998 \
1999 \
2000 \
2001 \
2002 __gmp_x = (src)[0]; \
2003 __gmp_r = __gmp_x OP (v); \
2004 (dst)[0] = __gmp_r; \
2005 if (CB (__gmp_r, __gmp_x, (v))) \
2006 { \
2007 (cout) = 1; \
2008 for (__gmp_i = 1; __gmp_i < (n);) \
2009 { \
2010 __gmp_x = (src)[__gmp_i]; \
2011 __gmp_r = __gmp_x OP 1; \
2012 (dst)[__gmp_i] = __gmp_r; \
2013 ++__gmp_i; \
2014 if (!CB (__gmp_r, __gmp_x, 1)) \
2015 { \
2016 if ((src) != (dst)) \
2017 __GMPN_COPY_REST (dst, src, n, __gmp_i); \
2018 (cout) = 0; \
2019 break; \
2020 } \
2021 } \
2022 } \
2023 else \
2024 { \
2025 if ((src) != (dst)) \
2026 __GMPN_COPY_REST (dst, src, n, 1); \
2027 (cout) = 0; \
2028 } \
2029 } while (0)
2030 #endif
2031
2032 #if GMP_NAIL_BITS >= 1
2033 #define __GMPN_AORS_1(cout, dst, src, n, v, OP, CB) \
2034 do { \
2035 mp_size_t __gmp_i; \
2036 mp_limb_t __gmp_x, __gmp_r; \
2037 \
2038 \
2039 \
2040 \
2041 __gmp_x = (src)[0]; \
2042 __gmp_r = __gmp_x OP (v); \
2043 (dst)[0] = __gmp_r & GMP_NUMB_MASK; \
2044 if (__gmp_r >> GMP_NUMB_BITS != 0) \
2045 { \
2046 (cout) = 1; \
2047 for (__gmp_i = 1; __gmp_i < (n);) \
2048 { \
2049 __gmp_x = (src)[__gmp_i]; \
2050 __gmp_r = __gmp_x OP 1; \
2051 (dst)[__gmp_i] = __gmp_r & GMP_NUMB_MASK; \
2052 ++__gmp_i; \
2053 if (__gmp_r >> GMP_NUMB_BITS == 0) \
2054 { \
2055 if ((src) != (dst)) \
2056 __GMPN_COPY_REST (dst, src, n, __gmp_i); \
2057 (cout) = 0; \
2058 break; \
2059 } \
2060 } \
2061 } \
2062 else \
2063 { \
2064 if ((src) != (dst)) \
2065 __GMPN_COPY_REST (dst, src, n, 1); \
2066 (cout) = 0; \
2067 } \
2068 } while (0)
2069 #endif
2070
2071 #define __GMPN_ADDCB(r,x,y) ((r) < (y))
2072 #define __GMPN_SUBCB(r,x,y) ((x) < (y))
2073
2074 #define __GMPN_ADD_1(cout, dst, src, n, v) \
2075 __GMPN_AORS_1(cout, dst, src, n, v, +, __GMPN_ADDCB)
2076 #define __GMPN_SUB_1(cout, dst, src, n, v) \
2077 __GMPN_AORS_1(cout, dst, src, n, v, -, __GMPN_SUBCB)
2078
2079
2080
2081
2082
2083 #define __GMPN_CMP(result, xp, yp, size) \
2084 do { \
2085 mp_size_t __gmp_i; \
2086 mp_limb_t __gmp_x, __gmp_y; \
2087 \
2088 \
2089 \
2090 (result) = 0; \
2091 __gmp_i = (size); \
2092 while (--__gmp_i >= 0) \
2093 { \
2094 __gmp_x = (xp)[__gmp_i]; \
2095 __gmp_y = (yp)[__gmp_i]; \
2096 if (__gmp_x != __gmp_y) \
2097 { \
2098 \
2099 (result) = (__gmp_x > __gmp_y ? 1 : -1); \
2100 break; \
2101 } \
2102 } \
2103 } while (0)
2104
2105
2106 #if defined (__GMPN_COPY) && ! defined (__GMPN_COPY_REST)
2107 #define __GMPN_COPY_REST(dst, src, size, start) \
2108 do { \
2109 \
2110 \
2111 __GMPN_COPY ((dst)+(start), (src)+(start), (size)-(start)); \
2112 } while (0)
2113 #endif
2114
2115
2116
2117
2118 #if ! defined (__GMPN_COPY_REST)
2119 #define __GMPN_COPY_REST(dst, src, size, start) \
2120 do { \
2121 mp_size_t __gmp_j; \
2122 \
2123 \
2124 \
2125 \
2126 __GMP_CRAY_Pragma ("_CRI ivdep"); \
2127 for (__gmp_j = (start); __gmp_j < (size); __gmp_j++) \
2128 (dst)[__gmp_j] = (src)[__gmp_j]; \
2129 } while (0)
2130 #endif
2131
2132
2133
2134
2135
2136 #if ! defined (__GMPN_COPY)
2137 #define __GMPN_COPY(dst, src, size) __GMPN_COPY_REST (dst, src, size, 0)
2138 #endif
2139
2140
2141 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_add)
2142 #if ! defined (__GMP_FORCE_mpn_add)
2143 __GMP_EXTERN_INLINE
2144 #endif
2145 mp_limb_t
2146 mpn_add (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize)
2147 {
2148 mp_limb_t __gmp_c;
2149 __GMPN_ADD (__gmp_c, __gmp_wp, __gmp_xp, __gmp_xsize, __gmp_yp, __gmp_ysize);
2150 return __gmp_c;
2151 }
2152 #endif
2153
2154 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_add_1)
2155 #if ! defined (__GMP_FORCE_mpn_add_1)
2156 __GMP_EXTERN_INLINE
2157 #endif
2158 mp_limb_t
2159 mpn_add_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) __GMP_NOTHROW
2160 {
2161 mp_limb_t __gmp_c;
2162 __GMPN_ADD_1 (__gmp_c, __gmp_dst, __gmp_src, __gmp_size, __gmp_n);
2163 return __gmp_c;
2164 }
2165 #endif
2166
2167 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_cmp)
2168 #if ! defined (__GMP_FORCE_mpn_cmp)
2169 __GMP_EXTERN_INLINE
2170 #endif
2171 int
2172 mpn_cmp (mp_srcptr __gmp_xp, mp_srcptr __gmp_yp, mp_size_t __gmp_size) __GMP_NOTHROW
2173 {
2174 int __gmp_result;
2175 __GMPN_CMP (__gmp_result, __gmp_xp, __gmp_yp, __gmp_size);
2176 return __gmp_result;
2177 }
2178 #endif
2179
2180 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_zero_p)
2181 #if ! defined (__GMP_FORCE_mpn_zero_p)
2182 __GMP_EXTERN_INLINE
2183 #endif
2184 int
2185 mpn_zero_p (mp_srcptr __gmp_p, mp_size_t __gmp_n) __GMP_NOTHROW
2186 {
2187
2188 do {
2189 if (__gmp_p[--__gmp_n] != 0)
2190 return 0;
2191 } while (__gmp_n != 0);
2192 return 1;
2193 }
2194 #endif
2195
2196 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_sub)
2197 #if ! defined (__GMP_FORCE_mpn_sub)
2198 __GMP_EXTERN_INLINE
2199 #endif
2200 mp_limb_t
2201 mpn_sub (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize)
2202 {
2203 mp_limb_t __gmp_c;
2204 __GMPN_SUB (__gmp_c, __gmp_wp, __gmp_xp, __gmp_xsize, __gmp_yp, __gmp_ysize);
2205 return __gmp_c;
2206 }
2207 #endif
2208
2209 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_sub_1)
2210 #if ! defined (__GMP_FORCE_mpn_sub_1)
2211 __GMP_EXTERN_INLINE
2212 #endif
2213 mp_limb_t
2214 mpn_sub_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) __GMP_NOTHROW
2215 {
2216 mp_limb_t __gmp_c;
2217 __GMPN_SUB_1 (__gmp_c, __gmp_dst, __gmp_src, __gmp_size, __gmp_n);
2218 return __gmp_c;
2219 }
2220 #endif
2221
2222 #if defined (__GMP_EXTERN_INLINE) || defined (__GMP_FORCE_mpn_neg)
2223 #if ! defined (__GMP_FORCE_mpn_neg)
2224 __GMP_EXTERN_INLINE
2225 #endif
2226 mp_limb_t
2227 mpn_neg (mp_ptr __gmp_rp, mp_srcptr __gmp_up, mp_size_t __gmp_n)
2228 {
2229 while (*__gmp_up == 0)
2230 {
2231 *__gmp_rp = 0;
2232 if (!--__gmp_n)
2233 return 0;
2234 ++__gmp_up; ++__gmp_rp;
2235 }
2236
2237 *__gmp_rp = (- *__gmp_up) & GMP_NUMB_MASK;
2238
2239 if (--__gmp_n)
2240 mpn_com (++__gmp_rp, ++__gmp_up, __gmp_n);
2241
2242 return 1;
2243 }
2244 #endif
2245
2246 #if defined (__cplusplus)
2247 }
2248 #endif
2249
2250
2251
2252 #define mpz_sgn(Z) ((Z)->_mp_size < 0 ? -1 : (Z)->_mp_size > 0)
2253 #define mpf_sgn(F) ((F)->_mp_size < 0 ? -1 : (F)->_mp_size > 0)
2254 #define mpq_sgn(Q) ((Q)->_mp_num._mp_size < 0 ? -1 : (Q)->_mp_num._mp_size > 0)
2255
2256
2257 #if defined (__GNUC__) && __GNUC__ >= 2
2258 #define mpz_cmp_ui(Z,UI) \
2259 (__builtin_constant_p (UI) && (UI) == 0 \
2260 ? mpz_sgn (Z) : _mpz_cmp_ui (Z,UI))
2261 #define mpz_cmp_si(Z,SI) \
2262 (__builtin_constant_p ((SI) >= 0) && (SI) >= 0 \
2263 ? mpz_cmp_ui (Z, __GMP_CAST (unsigned long, SI)) \
2264 : _mpz_cmp_si (Z,SI))
2265 #define mpq_cmp_ui(Q,NUI,DUI) \
2266 (__builtin_constant_p (NUI) && (NUI) == 0 ? mpq_sgn (Q) \
2267 : __builtin_constant_p ((NUI) == (DUI)) && (NUI) == (DUI) \
2268 ? mpz_cmp (mpq_numref (Q), mpq_denref (Q)) \
2269 : _mpq_cmp_ui (Q,NUI,DUI))
2270 #define mpq_cmp_si(q,n,d) \
2271 (__builtin_constant_p ((n) >= 0) && (n) >= 0 \
2272 ? mpq_cmp_ui (q, __GMP_CAST (unsigned long, n), d) \
2273 : _mpq_cmp_si (q, n, d))
2274 #else
2275 #define mpz_cmp_ui(Z,UI) _mpz_cmp_ui (Z,UI)
2276 #define mpz_cmp_si(Z,UI) _mpz_cmp_si (Z,UI)
2277 #define mpq_cmp_ui(Q,NUI,DUI) _mpq_cmp_ui (Q,NUI,DUI)
2278 #define mpq_cmp_si(q,n,d) _mpq_cmp_si(q,n,d)
2279 #endif
2280
2281
2282
2283
2284
2285 #define mpz_odd_p(z) (((z)->_mp_size != 0) & __GMP_CAST (int, (z)->_mp_d[0]))
2286 #define mpz_even_p(z) (! mpz_odd_p (z))
2287
2288
2289
2290
2291 #ifdef __cplusplus
2292 __GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpz_srcptr);
2293 __GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpq_srcptr);
2294 __GMP_DECLSPEC_XX std::ostream& operator<< (std::ostream &, mpf_srcptr);
2295 __GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpz_ptr);
2296 __GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpq_ptr);
2297 __GMP_DECLSPEC_XX std::istream& operator>> (std::istream &, mpf_ptr);
2298 #endif
2299
2300
2301
2302 #define mpn_divmod(qp,np,nsize,dp,dsize) \
2303 mpn_divrem (qp, __GMP_CAST (mp_size_t, 0), np, nsize, dp, dsize)
2304
2305
2306 #define mpz_mdiv mpz_fdiv_q
2307 #define mpz_mdivmod mpz_fdiv_qr
2308 #define mpz_mmod mpz_fdiv_r
2309 #define mpz_mdiv_ui mpz_fdiv_q_ui
2310 #define mpz_mdivmod_ui(q,r,n,d) \
2311 (((r) == 0) ? mpz_fdiv_q_ui (q,n,d) : mpz_fdiv_qr_ui (q,r,n,d))
2312 #define mpz_mmod_ui(r,n,d) \
2313 (((r) == 0) ? mpz_fdiv_ui (n,d) : mpz_fdiv_r_ui (r,n,d))
2314
2315
2316 #define mpz_div mpz_fdiv_q
2317 #define mpz_divmod mpz_fdiv_qr
2318 #define mpz_div_ui mpz_fdiv_q_ui
2319 #define mpz_divmod_ui mpz_fdiv_qr_ui
2320 #define mpz_div_2exp mpz_fdiv_q_2exp
2321 #define mpz_mod_2exp mpz_fdiv_r_2exp
2322
2323 enum
2324 {
2325 GMP_ERROR_NONE = 0,
2326 GMP_ERROR_UNSUPPORTED_ARGUMENT = 1,
2327 GMP_ERROR_DIVISION_BY_ZERO = 2,
2328 GMP_ERROR_SQRT_OF_NEGATIVE = 4,
2329 GMP_ERROR_INVALID_ARGUMENT = 8,
2330 GMP_ERROR_MPZ_OVERFLOW = 16
2331 };
2332
2333
2334 #define __GMP_CC "/opt/spack/lib/spack/env/gcc/gcc"
2335 #define __GMP_CFLAGS "-O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8"
2336
2337
2338 #define __GNU_MP_VERSION 6
2339 #define __GNU_MP_VERSION_MINOR 3
2340 #define __GNU_MP_VERSION_PATCHLEVEL 0
2341 #define __GNU_MP_RELEASE (__GNU_MP_VERSION * 10000 + __GNU_MP_VERSION_MINOR * 100 + __GNU_MP_VERSION_PATCHLEVEL)
2342
2343 #define __GMP_H__
2344 #endif