Edit report at http://bugs.php.net/bug.php?id=54459&edit=1
ID: 54459 Updated by: ahar...@php.net Reported by: mail at anthonysterling dot com Summary: Range function accuracy -Status: Open +Status: Closed Type: Feature/Change Request Package: Unknown/Other Function Operating System: Mixed PHP Version: Irrelevant -Assigned To: +Assigned To: aharvey Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2011-04-06 12:23:08] ahar...@php.net Automatic comment from SVN on behalf of aharvey Revision: http://svn.php.net/viewvc/?view=revision&revision=309986 Log: Implement FR #54459 (Range function accuracy) by changing the way range() calculates values when used with floating point bounds/step. ------------------------------------------------------------------------ [2011-04-04 11:04:27] cataphr...@php.net I'm changing it to a request then. But it's clear the function currently works as documented. What you want is some sort of correction to the cumulating errors. I suppose this is possible, but do you have any algorithm to suggest here?.. ------------------------------------------------------------------------ [2011-04-04 09:15:50] mail at anthonysterling dot com Thanks. I understand *why* this happens, I'm just don't think this is expected nor desirable. Should this not be compensated/adjusted for before reaching user-land as the intent is pretty clear (increment in 10% steps). Thanks again. Anthony. ------------------------------------------------------------------------ [2011-04-04 00:13:12] cataphr...@php.net .1 is not exactly representable; the rounding error is propagated through the multiplication until it gets big enough to affect the displayed number for the desired precision. Bogus. ------------------------------------------------------------------------ [2011-04-03 21:29:14] mail at anthonysterling dot com Reducing the precision to a value equal to, or lower than 13 appears to address it. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=54459 -- Edit this bug report at http://bugs.php.net/bug.php?id=54459&edit=1