gmp_intval(3) php man page | unix.com

Man Page: gmp_intval

Operating Environment: php

Section: 3

GMP_INTVAL(3)								 1							     GMP_INTVAL(3)

gmp_intval - Convert GMP number to integer

SYNOPSIS
int gmp_intval (GMP $gmpnumber)
DESCRIPTION
This function converts GMP number into native PHP integers.
PARAMETERS
o $gmpnumber -Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.
RETURN VALUES
The integer value of $gmpnumber.
EXAMPLES
Example #1 gmp_intval(3) example <?php // displays correct result echo gmp_intval("2147483647") . " "; // displays wrong result, above PHP integer limit echo gmp_intval("2147483648") . " "; // displays correct result echo gmp_strval("2147483648") . " "; ?> The above example will output: 2147483647 2147483647 2147483648
NOTES
Warning This function returns a useful result only if the number actually fits the PHP integer (i.e., signed long type). If you want just to print the GMP number, use gmp_strval(3). PHP Documentation Group GMP_INTVAL(3)
Related Man Pages
intval(3) - php
gmp_div_r(3) - php
gmp_hamdist(3) - php
gmp_init(3) - php
gmp_setbit(3) - php
Similar Topics in the Unix Linux Community
UNIX.COM 2017 Year End Summary
Coming Soon: Upgrade Forum Software (Dec 31 - Jan 1)
Please Welcome Don Cragun as Lead Moderator
The Order of the Wizard's Hat - Lifetime Achievement Award 2019 - Congrats to Wolf Machowitsch
Please Welcome Nicki Paul to the Moderator Team!