Liste des Groupes | Revenir à cl c++ |
On 16/08/2024 18:35, Bonita Montero wrote:You can skip multiples of three, by starting with 7, and thenBut basically I don't think it is a good idea to skip numbers exeptI've been running some experiments.
multiples of two. With the three you save a sixth of memory, with
the five you save a 15-th and at the end you get about 20% less
storage (1 / (2 * 3) + 1 / (2 * 3 * 5) + 1 / (2 * 3 * 5 * 7) ...)
for a lot of computation. That's the point where I dropped this
idea and I think this extra computation is higher than the time
for the saved memory loads.
Skipping evens only is nice and simple on computation; that's good.
Skipping something else requires table lookups. I've knocked up some code that uses the correct table for skipping primes (but not for mask bit selection) and run it for 2*3*5, 2*3*5*7, and 2*3*5*7*11.
>
Les messages affichés proviennent d'usenet.