Next: Number Theoretic Functions, Previous: Integer Exponentiation, Up: Integer Functions [Index]
Set rop to the truncated integer part of the nth root of op. Return non-zero if the computation was exact, i.e., if op is rop to the nth power.
Set root to the truncated integer part of the nth root of u. Set rem to the remainder, u-root**n.
Set rop to the truncated integer part of the square root of op.
Set rop1 to the truncated integer part
of the square root of op, like mpz_sqrt
. Set rop2 to the
remainder op-rop1*rop1, which will be zero if op is a
perfect square.
If rop1 and rop2 are the same variable, the results are undefined.
Return non-zero if op is a perfect power, i.e., if there exist integers a and b, with b>1, such that 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.
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]