Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!srhqla!demott!kdq From: kdq@demott.COM (Kevin D. Quitt) Newsgroups: comp.lang.c Subject: Re: How to reverse bits... Message-ID: <496@demott.COM> Date: 14 Aug 90 21:04:54 GMT References: <2059@ux.acs.umn.edu> Reply-To: kdq@demott.COM (Kevin D. Quitt) Organization: DeMott Electronics Co., Van Nuys CA Lines: 21 In article <2059@ux.acs.umn.edu> dhoyt@vw.acs.umn.edu writes: >In article <1990Aug13.185757.3236@sti.fi>, ttl@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@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.