3 ms·
> This does not require division... From the link: IDIVM D,C
by tasty_freeze 4y ago
> This does not require division...
From the link:
IDIVM D,C
- pbsd 4y ago"This" as in finding the next combination. Gosper's trick does.
- danbruc 4y agoThe division performs a right shift, the version given in the FXT book replaces it with a while loop and has the note that one could use a bit scan and a shift. I would assume bit scan and shift is the fastest option - if accessible from the language used - but I am not sure if the loop could beat the division. Also the version from the EA library claims to - but fails to - perform the wrap around, the version in the FXT book does not try to wrap around and I would guess the version in HAKMEM also does not wrap around properly.