Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

gmp_perfect_power

Description

The gmp_perfect_power of GMP for PHP perfect power check.

Syntax

gmp_perfect_power(
    GMP|int|string $num
): bool

Parameters

num

A GMP object, an int or a numeric string.

Return

Returns true if num is a perfect power, false otherwise.

Examples

1 · num · GMP

<?

$num = 4;

$num = gmp_init($num);

$return = gmp_perfect_power($num);

var_export($return);

?>
true

2 · num · int

<?

$num = 4;

$return = gmp_perfect_power($num);

var_export($return);

?>
true

3 · num · string

<?

$num = "4";

$return = gmp_perfect_power($num);

var_export($return);

?>
true
HomeMenu