Skip to content

Conversation

@tpunt
Copy link
Contributor

@tpunt tpunt commented Apr 14, 2016

Resolves bug #72017.

This is a little hacky, but it works. It should really be noted that range() does not work well with floats because of the precision problem.

There's still cases where range() will not work:

var_dump(range(90, 90.1, .1)); // bool(false)

(3v4l.)

I can't see a fix to these, however.

@tpunt tpunt force-pushed the resolve-bug-72017 branch 3 times, most recently from 98be737 to f1552c1 Compare April 15, 2016 21:49
@tpunt tpunt force-pushed the resolve-bug-72017 branch from f1552c1 to bde145a Compare April 15, 2016 22:14
@laruence laruence added the Bug label Apr 19, 2016
@jhdxr
Copy link
Member

jhdxr commented Apr 20, 2016

I think it's ok. bug#72017 means bc break, we should fix it ASAP. but range(90, 90.1, .1) is a precision problem, we should add a note to documentation and let users handle this situation by themselves, unless we find a better solution.

@tpunt
Copy link
Contributor Author

tpunt commented May 12, 2016

@jhdxr There are no BC breaks with this bug fix, AFAICT.

@weltling This bug is also applicable to the PHP 7.0 branch (I submitted the PR against master instead of PHP 7.0, sorry).

@weltling
Copy link
Contributor

@tpunt i'll check anytime soon, thanks for the ping.

@weltling
Copy link
Contributor

@tpunt, merged, but having an issue closing the ticket. Will try yet tomorrow, or please you do.

Thanks!

@nikic nikic closed this May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants