07-06-2023, 08:00 PM
(07-06-2023, 07:16 PM)bplus Wrote: I don't know, can you find a formula? but your thing looks pretty fast! Have you looked at Rosetta Code this looks like a classic task for them.Yeah, this is actually a slightly modified version of the QBasic Rosetta Code post (I noted that at the top of the code block). The formula is straightforward for a procedural type approach.
Welcome to the forum!
Yes RC has it: https://rosettacode.org/wiki/Anti-primes#FreeBASIC
FreeBasic is usually a good one to compare with.
My main question (I should have been more clear) is: can I do anything else QB64 to tweak our some more speed. If you take the number of anti-primes from 45 to 50 it gets closer to 27 seconds and just rockets up from there.
I changed everything I could to INTEGER types (the fastest for QB64 I believe), and only used the LONG type when needed. This made a somewhat amazing/surprising increase in speed.
Short of a functional or vectorized approach, I am just looking if I am missing something obvious for speed....assuming no formula change.
Thanks again, and this was my first post and first reply on the forum!