typedef struct {char a[9];} t; t b(uint8_t x) { t s; for (int i=8; i>0; x>>=1) s.a[--i]=48+(x&1); s.a[8]=0; return s; }
-
-
decimal-coded binary (nice)
-
you can shift instead of multiplying by using octal-coded binary (%o).
- Show replies
New conversation -
-
-
if only I had a superoptimizer ...
-
@spun_off I guess the superoptimized version of this would be a lookup table with 256 entries.
- Show replies
New conversation -
-
-
Another version of this function that provides excellent job security. (Spending far too much time on this. :)pic.twitter.com/ONQldyCVZ6
-
Btw, this only works because the LSB bit pattern of (dec) 10, 100, 1000, ... is 0, 00, 000, ...
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.