Go to the first, previous, next, last section, table of contents.


Miscellaneous Functions

Function: int mpz_fits_ulong_p (mpz_t op)
Function: int mpz_fits_slong_p (mpz_t op)
Function: int mpz_fits_uint_p (mpz_t op)
Function: int mpz_fits_sint_p (mpz_t op)
Function: int mpz_fits_ushort_p (mpz_t op)
Function: int mpz_fits_sshort_p (mpz_t op)
Return non-zero iff the value of op fits in an unsigned long int, signed long int, unsigned int, signed int, unsigned short int, or signed short int, respectively. Otherwise, return zero.

Macro: int mpz_odd_p (mpz_t op)
Macro: int mpz_even_p (mpz_t op)
Determine whether op is odd or even, respectively. Return non-zero if yes, zero if no. These macros evaluate their arguments more than once.

Function: size_t mpz_size (mpz_t op)
Return the size of op measured in number of limbs. If op is zero, the returned value will be zero.

Function: size_t mpz_sizeinbase (mpz_t op, int base)
Return the size of op measured in number of digits in base base. The base may vary from 2 to 36. The returned value will be exact or 1 too big. If base is a power of 2, the returned value will always be exact.

This function is useful in order to allocate the right amount of space before converting op to a string. The right amount of allocation is normally two more than the value returned by mpz_sizeinbase (one extra for a minus sign and one for the terminating '\0').


Go to the first, previous, next, last section, table of contents.