Home :: International :: Manuals :: Howto :: FAQ :: Man Pages :: Email Login

 
 

 

gmp_intval

(PHP 4 >= 4.0.4, PHP 5)

gmp_intval -- Convertit un nombre GMP en entier

Description

int gmp_intval ( resource gmpnumber)

gmp_intval() convertit un nombre GMP en entier.

Avertissement

gmp_intval() 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().

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
 
 
 
 
Google
  Web Linuxinfor   
 

Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account

Document on this page is part of "Manuel PHP". See Index Page for more info about Authorship and Copyright.

1999-2009 Linuxinfor.com. No rights reserved.