php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #23563 base_convert is broken
Submitted: 2003-05-09 08:37 UTC Modified: 2004-04-01 04:51 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jaakkoho at paju dot oulu dot fi Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.1 OS: Linux 2.4 (Debian)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
32 + 50 = ?
Subscribe to this entry?

 
 [2003-05-09 08:37 UTC] 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. 
 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-11 02:07 UTC] 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-09-10 21:15 UTC] hholzgra@php.net
see also 23564
 [2004-04-01 04:51 UTC] irchtml@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 09:01:28 2024 UTC