number handling in php broken on 32bit system
Bug #184747 reported by
Alexander Kjäll
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php5 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: php5-cli
This program displays the error:
<?
printf("%u\n", ((1 << 31) - 1));
printf("%u\n", ((1 << 31) - 2));
printf("%u\n", ((1 << 31) - 3));
?>
On my 32bit machine it gives this output:
2147483648
2147483648
2147483648
and on my 64 bit this, same on my friends 32bit windows installaton:
2147483647
2147483646
2147483645
shifting a 1 31 steps shouldn't even overflow a 32bit variable, so there is something wrong here.
Changed in php5: | |
status: | Incomplete → Confirmed |
To post a comment you must log in.
Which version?
Thanks
chuck