Re: beginner question, NSNumber, NSDecimalAsNumber
Re: beginner question, NSNumber, NSDecimalAsNumber
- Subject: Re: beginner question, NSNumber, NSDecimalAsNumber
- From: Alastair Houghton <email@hidden>
- Date: Mon, 9 Nov 2009 14:52:44 +0000
On 9 Nov 2009, at 12:08, Graham Cox wrote:
On 09/11/2009, at 10:55 PM, Alastair Houghton wrote:
It's pretty easy to do a bit count on a fixed-size word (no need
for a loop, in fact).
There are some examples of how to do this here, including some
really, really clever methods. Is this what you had in mind Alastair?
http://gurmeetsingh.wordpress.com/2008/08/05/fast-bit-counting-routines/
Yes, those kinds of things.
Also, I neglected to point out that for binary and hexadecimal, it's
possible to do more than one digit at a time, even if you don't want
leading zeroes (for the non-leading-zeroes case, you just need two
tables of results, one with leading zeroes and one without, then the
first time you encounter a one bit, you swap from the no-leading-
zeroes table to the one with leading zeroes).
Anyway, there are lots of neat tricks of this nature.
(All of this probably isn't for newbie C programmers, though it's
perfectly possible that a newbie ObjC programmer might not be new to C
or C++.)
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden
References: | |
| >beginner question, NSNumber, NSDecimalAsNumber (From: Jay Swartzfeger <email@hidden>) |
| >Re: beginner question, NSNumber, NSDecimalAsNumber (From: Ron Fleckner <email@hidden>) |
| >Re: beginner question, NSNumber, NSDecimalAsNumber (From: Graham Cox <email@hidden>) |
| >Re: beginner question, NSNumber, NSDecimalAsNumber (From: Thomas Wetmore <email@hidden>) |
| >Re: beginner question, NSNumber, NSDecimalAsNumber (From: Alastair Houghton <email@hidden>) |
| >Re: beginner question, NSNumber, NSDecimalAsNumber (From: Graham Cox <email@hidden>) |