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

gmp_intval

Description

The gmp_intval of GMP for PHP converts GMP number to integer.

Syntax

gmp_intval(
    GMP|int|string $num
): int

Parameters

num

A GMP object, an int or a numeric string.

Return

Returns the int value of num.

Examples

1 · num · GMP

<?

$num = 0b111;

$num = gmp_init($num);

$return = gmp_intval($num);

echo $return;

?>
7

2 · num · int

<?

$num = 0b111;

$return = gmp_intval($num);

echo $return;

?>
7

3 · num · string

<?

$num = "0b111";

$return = gmp_intval($num);

echo $return;

?>
7
HomeMenu