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

search for in the

gmp_invert> <gmp_init
Last updated: Fri, 26 Dec 2008

view this page in

gmp_intval

(PHP 4 >= 4.0.4, PHP 5)

gmp_intvalConvertit un nombre GMP en entier

Description

int gmp_intval ( resource $gmpnumber )

convertit un nombre GMP en entier.

Liste de paramètres

gmpnumber

Un nombre GMP.

Valeurs de retour

Un entier, représentant le nombre gmpnumber .

Exemples

Exemple #1 Exemple avec gmp_intval()

<?php
// Affiche le bon résultat
echo gmp_intval("2147483647") . "\n";

// Affiche un mauvais résultat, hors de portée des entiers PHP
echo gmp_intval("2147483648") . "\n";

// Affiche le bon résultat
echo gmp_strval("2147483648") . "\n";
?>

L'exemple ci-dessus va afficher :

2147483647
2147483647
2147483648

Notes

Avertissement

Retourne un résultat cohérent uniquement si le nombre GMP peut être représenté par un entier PHP (i.e. type long signé). Si vous vous voulez simplement afficher un nombre GMP, utilisez plutôt gmp_strval().



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

gmp_invert> <gmp_init
Last updated: Fri, 26 Dec 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites