DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(gmp.info.gz) Assigning Integers

Info Catalog (gmp.info.gz) Initializing Integers (gmp.info.gz) Integer Functions (gmp.info.gz) Simultaneous Integer Init & Assign
 
 Assignment Functions
 ====================
 
 These functions assign new values to already initialized integers
 ( Initializing Integers).
 
  - Function: void mpz_set (mpz_t ROP, mpz_t OP)
  - Function: void mpz_set_ui (mpz_t ROP, unsigned long int OP)
  - Function: void mpz_set_si (mpz_t ROP, signed long int OP)
  - Function: void mpz_set_d (mpz_t ROP, double OP)
  - Function: void mpz_set_q (mpz_t ROP, mpq_t OP)
  - Function: void mpz_set_f (mpz_t ROP, mpf_t OP)
      Set the value of ROP from OP.
 
      `mpz_set_d', `mpz_set_q' and `mpz_set_f' truncate OP to make it an
      integer.
 
  - Function: int mpz_set_str (mpz_t ROP, char *STR, int BASE)
      Set the value of ROP from STR, a null-terminated C string in base
      BASE.  White space is allowed in the string, and is simply ignored.
 
      The BASE may vary from 2 to 62, or if BASE is 0, then the leading
      characters are used: `0x' and `0X' for hexadecimal, `0b' and `0B'
      for binary, `0' for octal, or decimal otherwise.
 
      For bases up to 36, case is ignored; upper-case and lower-case
      letters have the same value.  For bases 37 to 62, upper-case
      letter represent the usual 10..35 while lower-case letter
      represent 36..61.
 
      This function returns 0 if the entire string is a valid number in
      base BASE.  Otherwise it returns -1.
 
  - Function: void mpz_swap (mpz_t ROP1, mpz_t ROP2)
      Swap the values ROP1 and ROP2 efficiently.
 
Info Catalog (gmp.info.gz) Initializing Integers (gmp.info.gz) Integer Functions (gmp.info.gz) Simultaneous Integer Init & Assign
automatically generated byinfo2html