ID:               49071
 Updated by:       j...@php.net
 Reported By:      erha at freemail dot hu
-Status:           Open
+Status:           Bogus
 Bug Type:         GNU MP related
 Operating System: windows
 PHP Version:      5.2.10
 New Comment:

RTFM, http://php.net/gmp_intval 

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


Previous Comments:
------------------------------------------------------------------------

[2009-07-27 10:59:15] erha at freemail dot hu

Description:
------------
In the following code gmp_intval returns bad results. Replace it with
gmp_strval to see the difference:




Reproduce code:
---------------
$val = "19991231235958";
$value = gmp_init($val);
$res = gmp_div_qr($value, "0x100000000");
$b1 = (string) gmp_intval($res[1]);
$b2 = (string) gmp_intval($res[0]);
echo "$b1 $b2";



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49071&edit=1

Reply via email to