note 65413 rejected from function.sprintf by bjori
| From: | bjori@php.net | Date: | Sun, 30 Apr 2006 13:39:12 +0000 |
| Subject: | note 65413 rejected from function.sprintf by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-110180@lists.php.net to get a copy of this message | ||
Note Submitter: marc dot vanwoerkom at fernuni-hagen dot de
----
%X seems to implicitly cast to signed integer, I would mention this.
$calculated = sprintf("%X", $u);
The unsigned value is unaltered:
u = 567540899 expected = 21D3FCA3 calculated = 21D3FCA3 OK
The signed value gets altered by some overflow:
u = 2920013171 expected = AE0BDD73 calculated = 7FFFFFFF ERROR