php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #23564 base_convert() ignores last character
Submitted: 2003-05-09 09:22 UTC Modified: 2004-04-01 04:50 UTC
From: jaakkoho at paju dot oulu dot fi Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.2RC3-dev OS: Linux 2.4 (Debian)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jaakkoho at paju dot oulu dot fi
New email:
PHP Version: OS:

 

 [2003-05-09 09:22 UTC] jaakkoho at paju dot oulu dot fi
Both the following commands outputs same value: 
 
base_convert("aaaaaaaaaaa", 36, 10); 
base_convert("aaaaaaaaaab", 36, 10); 
 
output: 37606201097790608 
 
In fact, the last character can be whatever between 0-z, 
and the output is always same. 
 
This bug appears only if strlen($string_to_convert) > 10. 
 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-15 07:33 UTC] derick@php.net
Found the problem... the float (internally) reaches maximum precision in the case. Going to try to fix it in some way.
 [2003-05-15 09:10 UTC] derick@php.net
Okay, this is definitely not trivial to fix and making this a documentation problem instead: base_convert() loses precision on big numbers due to float properties.

Derick
 [2003-09-10 21:15 UTC] hholzgra@php.net
see also  23563
 [2004-04-01 04:50 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 Nov 28 20:01:28 2024 UTC