Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

14 already assumes unsigned accumulator! 255 [accumulator capacity] / (2 [shuffle-adds] * 9 [highest digit value]) ~= 14


You could have a separate accumulator for each shuffle, which should allow 28 iterations. (and merge those together at the end of the 28-iteration-loop by widening to u16; at which point you could have an outer loop accumulating in u16 until that runs out)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: