php man page for gmp_intval

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 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
bindec(3) - php
gmp_div_q(3) - php
gmp_div_qr(3) - php
gmp_gcdext(3) - php
Similar Topics in the Unix Linux Community
User Guide: Posting in the Emergency Forum
New Code Tags (Syntax Highlighting)
Please Welcome Don Cragun as Lead Moderator
Please Welcome Ravinder Singh to the Moderation Team
The Order of the Wizard's Hat - Lifetime Achievement Award 2019 - Congrats to Don Cragun