4
evalie
8y

!rant
Just posted some swift code to a server, in a few hours I should have all the prime numbers from 1 to a billion!

Comments
  • 1
    @alwaysmpe thank you! I'll look into this for the next iteration. Right now I'm finding primes by testing the divisibility of each number by the array of primes before it. So 2 isn't divisible by an empty array so it's added, 3 isn't divisible by 2 so 3 is added, 4 is divisible by 2 so it isn't added but 5 isn't divisible by 2 or 3 so it is added, and so on
  • 0
    EDIT: even after a few days the code was no where near a billion... optimization is looking good right now....
Add Comment