in reply to Re^2: Why is this code so much slower than the same algorithm in C?
in thread Why is this code so much slower than the same algorithm in C?
Is there a reason to have them both?for values of x > 20 if x % 12 == 0 then x % 6 == 0
Update: In other words, order the list in descending order removing any exact multiples of previous items. When you reach 16, one of two things will happen. Either there will be a remainder and it will exit the loop or there won't be a remainder and it will continue. There is no need to test 8 after 16.
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Why is this code so much slower than the same algorithm in C? (2s)
by tye (Sage) on Dec 10, 2008 at 20:46 UTC | |
by snowhare (Friar) on Dec 11, 2008 at 19:11 UTC | |
by tye (Sage) on Dec 12, 2008 at 03:31 UTC | |
by tilly (Archbishop) on Dec 15, 2008 at 13:19 UTC | |
by tye (Sage) on Dec 16, 2008 at 02:55 UTC | |
by tilly (Archbishop) on Dec 16, 2008 at 17:42 UTC | |
|
Re^4: Why is this code so much slower than the same algorithm in C?
by snowhare (Friar) on Dec 11, 2008 at 19:06 UTC |