iperfpow - determine if an integer is a perfect power
|
Calling Sequence
|
|
iperfpow(n)
iperfpow(n, 'p')
|
|
Description
|
|
•
|
If n is a positive integer and n = r^k, where r and k are positive integers, then iperfpow(n) returns r. If the second argument, 'p', is specified in the calling sequence, it is assigned the value k.
|
•
|
It is an error for n to evaluate to a numeric which is not a positive integer.
|
•
|
This function returns FAIL if it is not able to establish that n is a perfect power of an integer.
|
•
|
In all other cases, the function returns unevaluated.
|
|
|
Examples
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
|
|
Download Help Document
Was this information helpful?