Bug #53102 [Com]: the number 928 incorrectly packs (loses a bit)
| From: | markskilbeck@php.net | Date: | Tue, 19 Oct 2010 13:26:30 +0000 |
| Subject: | Bug #53102 [Com]: the number 928 incorrectly packs (loses a bit) | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-4487@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53102&edit=1
ID: 53102
Comment by: markskilbeck@php.net
Reported by: sharpg8867 at gmail dot com
Summary: the number 928 incorrectly packs (loses a bit)
Status: Open
Type: Bug
Package: PHP-GTK related
PHP Version: 5.2.14
Block user comment: N
New Comment:
Why is this PHP-GTK related?
Previous Comments:
------------------------------------------------------------------------
[2010-10-19 14:21:09] sharpg8867 at gmail dot com
Description:
------------
a) packing the value 928 (0x3A0) and 927 (0x39F) as unsigned long ("N")
always converts to 927 (0x39F)
b) masking the lower 8 bits of 0x3A0 always reads as 0x3F or 159
Note: phpinfo reports PHP Version 5.2.13
Test script:
---------------
$value = 928;
pack("N",$value) is 0x39f (927)
$value = 927;
pack("N",$value) is 0x39f (927)
$value = 928;
$v0 = $value & 0xff;
$v0 prints as 927
Expected result:
----------------
928 packs as 928.
Actual result:
--------------
928 packs as 927
Not good for computer to lose bits.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53102&edit=1