Doc #47901 [Com]: Need to define "large numbers" in base_convert limitations
| From: | exploringbinary at gmail dot com | Date: | Wed, 02 Mar 2016 02:54:00 +0000 |
| Subject: | Doc #47901 [Com]: Need to define "large numbers" in base_convert limitations | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13228@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=47901&edit=1
ID: 47901
Comment by: exploringbinary at gmail dot com
Reported by: exploringbinary at gmail dot com
Summary: Need to define "large numbers" in base_convert
limitations
Status: Not a bug
Type: Documentation Problem
Package: Documentation problem
Operating System: Windows
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
In my article http://www.exploringbinary.com/the-safe-range-for-phps-base-convert/
I define the limits for safe base_convert() conversions. You can consider drawing from it to update
your documentation.
Previous Comments:
------------------------------------------------------------------------
[2009-11-19 13:14:33] exploringbinary at gmail dot com
Yes, I know there's a link. My bug report quotes text from the paragraph that contains it.
There is nothing within that link, that I can see, that addresses my concern. If you see something
there, please be specific.
------------------------------------------------------------------------
[2009-11-19 11:14:41] vrana@php.net
There's a link to Floating point numbers.
------------------------------------------------------------------------
[2009-04-05 14:24:17] exploringbinary at gmail dot com
Description:
------------
The documentation for base_convert says "base_convert() may lose precision on large
numbers...". Can you define exactly what "large number" is? Without knowing the
limit, it's hard to trust the results.
I know you can't specify a single limit, because it could vary by implementation. It still
would be useful to define a limit for the most common implementations, like 32 bit unsigned integers
or IEEE double floating-point.
In the case of IEEE double floating-point, my guess is that the limit is 2^53, meaning that all
integers less than or equal to 2^53 will be converted correctly. (All integers from 0 to 2^53 can
fit in an IEEE double.)
Related bug reports:
Bug #23564 base_convert() ignores last character
Bug #35874 base_convert is off on numbers greater than 13 decimal places
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=47901&edit=1