Timeline for Finding Primes in Java
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 27, 2015 at 5:37 | comment | added | Stephan Branczyk | "An easy optimisation is to start your loop from 2 (1 is redundant)". Actually, you mean an easy micro-optimization (not worth making at all) is to start from 2. That micro optimization doesn't save you much time at all. I think you meant to say that all the even numbers are redundant since we already know they're all divisible by two. That means you can just increment your loop by two instead of just one and only work on the odd numbers, thus saving you half the time. Now, that's an optimization worth making. Of course, in that case you'd need to start your loop with an odd number as well. | |
Aug 3, 2014 at 10:59 | history | edited | K_P | CC BY-SA 3.0 |
added 1 character in body
|
Aug 3, 2014 at 10:25 | review | First posts | |||
Aug 3, 2014 at 10:47 | |||||
Aug 3, 2014 at 10:25 | history | answered | K_P | CC BY-SA 3.0 |