Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array.o() infinite loop #37

Closed
jmariner opened this issue Jul 31, 2017 · 3 comments
Closed

Array.o() infinite loop #37

jmariner opened this issue Jul 31, 2017 · 3 comments

Comments

@jmariner
Copy link
Contributor

The Array.o() function runs in an infinite loop if the argument given to it is both

  • > 1
  • not an integer

For example, [1,2,3]o1.5. This seems to be due to the fact that the loop used in that function relies on the counter becoming equal to zero, and that never occurs with a non-integer value.

@ETHproductions
Copy link
Owner

slaps 2015 me across the face

But seriously, I'll get this taken care of when I have a chance, probably tomorrow but maybe later. (BTW, how did you run across this?)

@jmariner
Copy link
Contributor Author

jmariner commented Aug 1, 2017

Found it when working on Fold a List in Half on PPCG; I was trying to pop the last Ul /2 items from the array and that would crash on an odd input array length. (I did get it working using Number.c() though)

@ETHproductions
Copy link
Owner

ETHproductions commented Aug 3, 2017

So for some reason it only occured to me now, 2 days later, that you're talking about Array.o() instead of Number.o(). I think the entire conversation makes sense either way though, other than the bug not existing on Number.o()...

Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants