Ok, after some refactoring, I think I have it figured out. I changed the for statement in the original code to a while statement.
I also changed the x variable to a long type instead of just an...
Type: Posts; User: mjr
Ok, after some refactoring, I think I have it figured out. I changed the for statement in the original code to a while statement.
I also changed the x variable to a long type instead of just an...
I get what you're saying about the primitive types. I do notice that in my code above I'm using an int type for the "number" variable, and a long for the step variable. So the step variable can go up...
Interesting. So if I understand what's going on correctly, I'm getting an uncaught overflow error. I thought I was using a large enough data type. Guess not.
Am I correct there?
Ok, I was recently writing a small java app that would print out values according to the Collatz Conjecture.
Collatz conjecture - Wikipedia, the free encyclopedia
Anyway, I noticed that after a...