IntIsPerfectPower
IntIsPerfectPower
Description
Test whether a value is a perfect power.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in | Value to test |
Usage example (from documentation)
bool power = IntIsPerfectPower(&value);Returns
true when the value can be written as a^b with b > 1.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:1295:
}
bool IntIsPerfectPower(Int *value) {
ValidateInt(value);- In
Int.Math.c:533:
bool test_int_is_perfect_power(void) {
WriteFmt("Testing IntIsPerfectPower\n");
Int power = IntFrom(81);- In
Int.Math.c:539:
Int one = IntFrom(1);
bool result = IntIsPerfectPower(&power);
result = result && !IntIsPerfectPower(&non_power);
result = result && IntIsPerfectPower(&one);- In
Int.Math.c:540:
bool result = IntIsPerfectPower(&power);
result = result && !IntIsPerfectPower(&non_power);
result = result && IntIsPerfectPower(&one);- In
Int.Math.c:541:
bool result = IntIsPerfectPower(&power);
result = result && !IntIsPerfectPower(&non_power);
result = result && IntIsPerfectPower(&one);
IntDeinit(&power);
Last updated on