You are viewing a single comment's thread. Return to all comments →
I did the same thing and used a Union with uint32_t raw; uint8_t digits[4];
That way I can use raw for assignment and comparison. Then I have overloaded things like ++.
This way I never need to use division to figure out the digits of a number.
It is still not fast enought for all of them.
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #33: Digit canceling fractions
You are viewing a single comment's thread. Return to all comments →
I did the same thing and used a Union with uint32_t raw; uint8_t digits[4];
That way I can use raw for assignment and comparison. Then I have overloaded things like ++.
This way I never need to use division to figure out the digits of a number.
It is still not fast enought for all of them.