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
bindec(3) - php
decbin(3) - php
gmp_div_qr(3) - php
gmp_random(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
Coming Soon: Upgrade Forum Software (Dec 31 - Jan 1)
Denial Of Service Attack Update
Please Welcome Nicki Paul to the Moderator Team!