php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11639 Errores de operaci?n con enteros negativos
Submitted: 2001-06-24 09:16 UTC Modified: 2001-06-24 09:34 UTC
From: rinconastur at freesurf dot fr Assigned:
Status: Closed Package: *Math Functions
PHP Version: 4.0.5 OS: Windows98
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rinconastur at freesurf dot fr
New email:
PHP Version: OS:

 

 [2001-06-24 09:16 UTC] rinconastur at freesurf dot fr
<? 
$a=-13;
$b=-87;
$c=-2147483647;
$d=-1073721824;
$e=-1073721824;
$s=-2147483600;

$f=$a+$b;
$r=$a+$c;
$g=$b+$c;
$m=$d+$e;
$w=$s+$b;

echo "Resultado correcto de a+b= -100<br>";
echo "Resultado de PHP...: ",$f,"<br><br>";

echo "Resultado correcto de a+c= -2147483660<br>";
echo "Resultado de PHP...: ",$r,"<br><br>";

echo "Resultado correcto de d+e= -2147483648<br>";
echo "Resultado de PHP...: ",$m,"<br><br>";

echo "Resultado correcto de s+b= -2147483687<br>";
echo "Resultado de PHP...: ",$w,"<br><br>";

?>



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-24 09:34 UTC] sniper@php.net
RTFM:

"These math functions will only handle values within the range of the long and double types on your computer. 
If you need to handle bigger numbers, take a look at the arbitrary precision math functions."

http://www.php.net/bc


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 03:01:28 2024 UTC