> On Mon, 2009/11/09, Alastair Houghton <alast...@alastairs-place.net> wrote: > From: Alastair Houghton <alast...@alastairs-place.net> > Subject: Re: beginner question, NSNumber, NSDecimalAsNumber > To: "Thomas Wetmore" <t...@verizon.net> > Cc: "list-cocoa-dev List" <cocoa-dev@lists.apple.com> > Date: Monday, 2009 November 9, 5:55 >> On 2009 Nov 09, at 10:49, Thomas Wetmore wrote: >> The approach found by Ron prints the bits in >> correct order... > > Or you can calculate the number of bits and > fill the buffer in reverse. It's pretty > easy to do a bit count on a fixed-size word > (no need for a loop, in fact).
Last I looked, 1-bit count was an assembly/ hardware instruction. Getting the highest order on-bit required a little cleverness. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com