#23563 [Opn]: base_convert is broken

From: Date: Thu, 11 Sep 2003 01:15:24 +0000
Subject: #23563 [Opn]: base_convert is broken
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969356269@lists.php.net to get a copy of this message
ID: 23563 Updated by: hholzgra@php.net Reported By: jaakkoho at paju dot oulu dot fi Status: Open Bug Type: Documentation problem Operating System: Linux 2.4 (Debian) PHP Version: 4.3.1 -Assigned To: +Assigned To: hholzgra New Comment: see also 23564 Previous Comments: ------------------------------------------------------------------------ [2003-05-11 02:07:13] moriyoshi@php.net PHP attempts to convert the numeric string to a double value within base_convert() function. And during this conversion, some lower digits may be lost due to the precision of the double value, which depends on the platform. http://www.php.net/manual/en/language.types.float.php ------------------------------------------------------------------------ [2003-05-09 08:37:03] jaakkoho at paju dot oulu dot fi Converting a decimal to n-base and then back to decimal failed: print base_convert(base_convert("10000000000000001", 10, 36), 36, 10); output: 10000000000000000 (the last '0' should be '1') Bug appears only if strlen($value_to_convert) > 16. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23563&edit=1

« previous php.doc (#969356269) next »