News for hackers. Stuff that matters.
Re:Worst Bug Ever by Pinckney on Monday January 21, 2013 @11:45AM (#5092213)
Thanks for posting this -- I just went and fixed just such a loop in my own code.
Re:Worst Bug Ever by swanson on Monday January 21, 2013 @12:04PM (#5092309)
Ha! Glad I could help :)
Re:Worst Bug Ever by Stwerp on Monday January 21, 2013 @12:13PM (#5092374)
Me too! I changed my array counter to 'j'. :P

I work in matlab a lot and have had this error creep up several times. It's very annoying, to say the least.

Re:Worst Bug Ever by swanson on Monday January 21, 2013 @12:28PM (#5092482)
The better fix - which I mentioned as well - is to use `2+3i` instead of `2+3*i`. The former will always use sqrt(-1).
Re:Worst Bug Ever by Stwerp on Monday January 21, 2013 @01:23PM (#5092814)
I agree. I think I picked up this syntax from Python. My response was intended as tongue-in-cheek answer since Matlab allows both i and j as the complex number. I mainly see this when editing or modifying scripts written by others in my lab and have to pinpoint their counter usage.