38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
Some compilers with hacks:
|
|
====================================
|
|
- GNUC
|
|
- DEC C
|
|
- SCO OpenUNIX 8 cc
|
|
- __cplusplus
|
|
|
|
Useful/undocumented macros in gmp.h:
|
|
====================================
|
|
__GMPN_ABS(x) - absolute value
|
|
__GMPN_MAX(h, i) - max of h and i
|
|
|
|
__GMPN_UINT_MAX - (int) ~0
|
|
__GMPN_ULONG_MAX - (unsigned long) ~0
|
|
__GMPN_USHRT_MAX - unsigned short) ~0
|
|
|
|
__GMPN_LIKELY(cond) - branch likely hint
|
|
__GMPN_UNLIKELY(cond) - branch unlikely hint
|
|
- e.g. if UNLIKELY(c >= 0L)....
|
|
|
|
Note: the __GMPN_ macros are redefined with nicer names in gmp-impl.h
|
|
|
|
mp_bits_per_limb - number of bits per limb
|
|
gmp_version - GMP version number i.j or i.j.k as a null terminated string
|
|
gmp_errno - integer corresponding to a GMP error condition:
|
|
0 none
|
|
1 unsupported argument
|
|
2 division by zero
|
|
4 sqrt of negative
|
|
8 invalid argument
|
|
|
|
Undocumented mpn functions prototyped in gmp.h:
|
|
===============================================
|
|
mp_limb_t mpn_preinv_mod_1(mp_srcptr sp, mp_size_t sn, mp_limb_t x, mp_limb_t xinv) -
|
|
compute {sp, sn} mod x given a precomputed inverse xinv of x
|
|
|
|
|