Re:How to save multiple numbers into one byte
by pjscott on Friday December 02, 2016 @07:27PM
(#13093465)
You should be able to replace the pow(2, x) part with (1 << x), so e.g. getbit() becomes
The compiler will turn the division and modulo into shifting and masking.
[ Parent
| on HN ]
Re:How to save multiple numbers into one byte
by deutronium on Friday December 02, 2016 @07:28PM
(#13093473)
Yeah that's a good point! Don't know why I didn't think about that.