News for hackers. Stuff that matters.
Re:8-bit number to binary string by acqq on Thursday November 05, 2015 @10:46AM (#10513930)
> You'd never want to use this approach at all in a production system

Actually it's not less useful than the code the compilers you depend on use all the time. They really depend on such "bit twiddles." Guy Steele agrees too, read his foreword to the "Hacker's Delight," a whole book about such functions:

http://www.hackersdelight.org/foreword.pdf

Re:8-bit number to binary string by Splines on Thursday November 05, 2015 @11:29AM (#10514232)
The difference being that the compiler knows what sort of bit-twiddling it should be doing and what sort of bit-twiddling it should not be doing.

I would not use this code without being very thoughtful and intentional about where it was being used.

Re:8-bit number to binary string by acqq on Thursday November 05, 2015 @11:43AM (#10514335)
> I would not use this code without being very thoughtful and intentional about where it was being used.

Sure, definitely not for everybody and every occasion. It's a platform dependent code. See my comment to cnvogel and look at his implementation for an example.