Next: Number Theoretic Functions, Previous: Integer Exponentiation, Up: Integer Functions [Index]

- Function:
*int***mpz_root***(mpz_t*`rop`, const mpz_t`op`, unsigned long int`n`) Set

`rop`to the truncated integer part of the`n`th root of`op`. Return non-zero if the computation was exact, i.e., if`op`is`rop`to the`n`th power.

- Function:
*void***mpz_rootrem***(mpz_t*`root`, mpz_t`rem`, const mpz_t`u`, unsigned long int`n`) Set

`root`to the truncated integer part of the`n`th root of`u`. Set`rem`to the remainder,.`u`-`root`**`n`

- Function:
*void***mpz_sqrt***(mpz_t*`rop`, const mpz_t`op`) Set

`rop`to the truncated integer part of the square root of`op`.

- Function:
*void***mpz_sqrtrem***(mpz_t*`rop1`, mpz_t`rop2`, const mpz_t`op`) Set

`rop1`to*the truncated integer part of the square root of*, like`op``mpz_sqrt`

. Set`rop2`to the remainder, which will be zero if`op`-`rop1`*`rop1``op`is a perfect square.If

`rop1`and`rop2`are the same variable, the results are undefined.

- Function:
*int***mpz_perfect_power_p***(const mpz_t*`op`) -
Return non-zero if

`op`is a perfect power, i.e., if there exist integersand`a`, with`b`, such that`b`>1.`op`equals`a`raised to the power`b`Under this definition both 0 and 1 are considered to be perfect powers. Negative values of

`op`are accepted, but of course can only be odd perfect powers.

- Function:
*int***mpz_perfect_square_p***(const mpz_t*`op`) -
Return non-zero if

`op`is a perfect square, i.e., if the square root of`op`is an integer. Under this definition both 0 and 1 are considered to be perfect squares.

Next: Number Theoretic Functions, Previous: Integer Exponentiation, Up: Integer Functions [Index]