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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 + 6 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Sat Apr 20 06:01:28 2024 UTC