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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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: Sat Dec 21 17:01:58 2024 UTC