Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while(*dp) { *dp -= 1; *(dp + offset) += factor; }
- // is not the same as; top works, bottom doesn't
- *(dp + offset) += *dp * factor;
- *dp = 0;
- // neither does this:
- u64 a = 0;
- while(*dp) { *dp -= 1; a += factor; }
- *(dp + offset) += a;
- // i chose u64 in case it overflows a u8
- // u8 doesn't work either
- // the top one must work because it handles overflows differently than the other two...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement