Calculating Anti-Primes - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Works in Progress (https://staging.qb64phoenix.com/forumdisplay.php?fid=9) +---- Thread: Calculating Anti-Primes (/showthread.php?tid=1816) Pages:
1
2
|
RE: Calculating Anti-Primes - Space_Ghost - 07-07-2023 (07-07-2023, 08:15 PM)Stuart Wrote: @Space_Ghost :Thank you Stuart. This is very helpful!! Greatly appeciated. Cheers. RE: Calculating Anti-Primes - david_uwi - 07-08-2023 Code: (Select All) DefLng A-S RE: Calculating Anti-Primes - Jack - 07-08-2023 while I am an advocate for explicit variable declaration, your program David, runs almost 3 times faster with DefLng A-S than with option _explicit and Dim As Long i, iq, j, isum, jk, kmax, knum, k RE: Calculating Anti-Primes - david_uwi - 07-08-2023 Strange! I've tried various assignments of the variables and DEFLNG A-S is the quickest. Maybe I have a very old version of QB64 (it says v2.0.2 at the bottom). When I've got something that works I do not like to download newer versions as they often cause problems. RE: Calculating Anti-Primes - Jack - 07-08-2023 David, I recommend that you try the latest QB64pe, you can always keep the older version RE: Calculating Anti-Primes - Space_Ghost - 07-08-2023 Thanks David and Jack! I really like your thoughts and code David. Jack I did not know about the DEFLNG A-S vs. _EXPLICIT....good to know! Cheers RE: Calculating Anti-Primes - Jack - 07-08-2023 Space_Gost I don't know if it applies in general or for isolated examples, it did apply for David's example RE: Calculating Anti-Primes - Kernelpanic - 08-13-2023 (07-08-2023, 04:39 PM)Jack Wrote: while I am an advocate for explicit variable declaration, your program David, runs almost 3 times faster with DefLng A-S than with option _explicit and Dim As Long i, iq, j, isum, jk, kmax, knum, kI don't think that's the reason for the speed increase. A test with and without $Console already shows different times. The results are peculiar. Without "Print knum" only half the time as with? |