PHP: gmp_intval - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

gmp_invert gmp_init

Last updated: Sat, 27 Jan 2007

view this page in

# gmp_intval

(PHP 4 >= 4.0.4, PHP 5)

gmp_intval -- Convert GMP number to integer

## Description

int gmp_intval ( resource gmpnumber )

This function allows to convert GMP number to integer.

Внимание
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().

Пример 1. gmp_intval() example

`<?php
// displays correct result
echo gmp_intval("2147483647") . "\n";
// displays wrong result, above PHP integer limit
echo gmp_intval("2147483648") . "\n";
// displays correct result
echo gmp_strval("2147483648") . "\n";
?>`

The printout of the above program will be:

    2147483647
    2147483647
    2147483648

add a note User Contributed Notes
gmp_intval
There are no user contributed notes for this page.
gmp_invert gmp_init

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST