Posts: 20
Threads: 2
Joined: Apr 2022
Reputation:
3
It's a very long time since I wrote that program. It looks a bit complicated, but basically it starts with an array (50 million binary digits - because we are only doing the odd numbers) all the binary digits are initially zero. Then it goes through setting every 3rd digit one then every 5th digit to one then every 7th... It wont do 9 as it is reading the next zero digit in the array (and 9 has been struck out by the 3 sieving).
I use only integer division and +, - (and mod -- is the mod value saved during the integer division in QB64?*).
*I do a lot of microprocessor programming these days and with the compiler I use you don't have to do integer division and mod. Both values are available after just an integer division.
Posts: 40
Threads: 2
Joined: May 2022
you guys should mash your heads together and write us a maths book!