My Project
Loading...
Searching...
No Matches
Functions
gmpext.h File Reference

utility functions for gmp More...

#include "cf_defs.h"
#include "imm.h"

Go to the source code of this file.

Functions

bool mpz_is_imm (const mpz_t mpi)
 

Detailed Description

utility functions for gmp

Definition in file gmpext.h.

Function Documentation

◆ mpz_is_imm()

bool mpz_is_imm ( const mpz_t  mpi)
inline

Definition at line 19 of file gmpext.h.

20{
21 if (mpi->_mp_size==0)
22 return true;
23 if ((mpi->_mp_size>1)||(mpi->_mp_size< -1))
24 return false;
25 return ( mpz_cmp_si( mpi, MINIMMEDIATE ) >= 0 ) &&
26 ( mpz_cmp_si( mpi, MAXIMMEDIATE ) <= 0 );
27}
const long MAXIMMEDIATE
Definition: imm.h:55
const long MINIMMEDIATE
Definition: imm.h:54