I am puzzled by the following code:
<?php
print "<p>MaxInt=".PH P_INT_MAX;
$AA = -190668411;
$BB = -2181087916;
print "<br>AA=$AA ";
print "<br>BB=$BB ";
$AA = (int)$AA + (int)$BB;
print "<br>AA+BB=$AA" ;
?>
On some systems, I get:
MaxInt=21474836 47
AA=-190668411
BB=-2181087916
AA+BB=-2338152059
On others, I get:
MaxInt=21474836 47
AA=-190668411
BB=-2181087916
AA+BB=192321096 9
Why the difference?
Thanks...Bruce
<?php
print "<p>MaxInt=".PH P_INT_MAX;
$AA = -190668411;
$BB = -2181087916;
print "<br>AA=$AA ";
print "<br>BB=$BB ";
$AA = (int)$AA + (int)$BB;
print "<br>AA+BB=$AA" ;
?>
On some systems, I get:
MaxInt=21474836 47
AA=-190668411
BB=-2181087916
AA+BB=-2338152059
On others, I get:
MaxInt=21474836 47
AA=-190668411
BB=-2181087916
AA+BB=192321096 9
Why the difference?
Thanks...Bruce
Comment