note 64039 added to function.base-convert
| From: | CJDennis at osu1 dot php dot net | Date: | Thu, 06 Apr 2006 08:03:26 +0000 |
| Subject: | note 64039 added to function.base-convert | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-107426@lists.php.net to get a copy of this message | ||
Really huge numbers might be truncated at both ends.
eg:
<?php
$binary="11010101001111010001110101000100011110010110110".
"001111000010001010001111001100011010110110010010011010".
"001011010000001001011111110001010101101101011010101010".
"000100011101110010110010100111110001010010111010110011".
"001111111100011001011011001110001111110000101011010010";
print(strtoupper(base_convert($binary, 2, 16)));
?>
will output:
9E8EA23CB63C0000000000000000000000000000000000000000000000000000 (64 hex digits)
when the correct result would be:
6A9E8EA23CB63C228F31AD9268B4097F156D6AA11DCB29F14BACCFF196CE3F0AD2 (66 hex digits)
Notice that as well as the result showing '0's after B63C which you would expect it is
also missing the first 6A before 9E.
----
Server IP: 203.16.234.90
Probable Submitter: 202.137.76.75
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.base-convert.php
Edit -- http://master.php.net/note/edit/64039
Del: integrated -- http://master.php.net/note/delete/64039/integrated
Del: useless -- http://master.php.net/note/delete/64039/useless
Del: bad code -- http://master.php.net/note/delete/64039/bad+code
Del: spam -- http://master.php.net/note/delete/64039/spam
Del: non-english -- http://master.php.net/note/delete/64039/non-english
Del: in docs -- http://master.php.net/note/delete/64039/in+docs
Del: other reasons-- http://master.php.net/note/delete/64039
Reject -- http://master.php.net/note/reject/64039
Search -- http://master.php.net/manage/user-notes.php