How to reverse bits...

Kevin D. Quitt kdq at demott.COM
Wed Aug 15 07:04:54 AEST 1990


In article <2059 at ux.acs.umn.edu> dhoyt at vw.acs.umn.edu writes:
>In article <1990Aug13.185757.3236 at sti.fi>, ttl at sti.fi (Timo Lehtinen) writes...
>>This might be trivial, but here goes...
>>What's the most optimal way to reverse the bits in an unsigned char,
>>i.e. change from MSB to LSB ordering ?
>
>  You don't have to change anything.  Big and little endians only cause
>trouble when you look at different integer formats.  Bytes is bytes, as they
>say.

    Hey Timo, isn't this special? You don't *really* want to reverse the
bits in your byte, you can just imagine them the other way around! Boy!
Does that save CPU cycles, or what?

-- 
 _
Kevin D. Quitt         demott!kdq   kdq at demott.com
DeMott Electronics Co. 14707 Keswick St.   Van Nuys, CA 91405-1266
VOICE (818) 988-4975   FAX (818) 997-1190  MODEM (818) 997-4496 PEP last

                96.37% of all statistics are made up.



More information about the Comp.lang.c mailing list