Query: gmp_intval
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
GMP_INTVAL(3) 1 GMP_INTVAL(3) gmp_intval - Convert GMP number to integerSYNOPSISint gmp_intval (GMP $gmpnumber)DESCRIPTIONThis function converts GMP number into native PHP integers.PARAMETERSo $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 VALUESThe integer value of $gmpnumber.EXAMPLESExample #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 2147483648NOTESWarning 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 |
|---|
| gmp_clrbit(3) - php |
| gmp_div_q(3) - php |
| gmp_div_r(3) - php |
| gmp_prob_prime(3) - php |
| gmp_strval(3) - php |
| Similar Topics in the Unix Linux Community |
|---|
| User Guide: Posting in the Emergency Forum |
| UNIX.COM 2017 Year End Summary |
| New Code Tags (Syntax Highlighting) |
| Please Welcome Nicki Paul to the Moderator Team! |