Timeline for compute number of 1 bits in a binary representation of a number
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 10, 2012 at 3:05 | comment | added | ratchet freak | @gnibbler cache lines can be as small as 4 words | |
Jan 10, 2012 at 3:02 | comment | added | gnibbler | Is a 256 byte table really too large for the cache? | |
Jan 10, 2012 at 2:49 | comment | added | ratchet freak | @gnibbler then you get caching issues | |
Jan 10, 2012 at 1:12 | comment | added | gnibbler | I think a lookup table will be faster. For an 8 bit lookup table, you only need 4 lookups and 3 additions to do 32 bit. 16 bit lookup table will be slightly faster but much bigger. | |
Jan 10, 2012 at 0:20 | comment | added | ratchet freak | @Gajet you can use shift and mask (its dividing and mod by a power of 2) I edited to clarify | |
Jan 10, 2012 at 0:19 | history | edited | ratchet freak | CC BY-SA 3.0 |
added 51 characters in body
|
Jan 10, 2012 at 0:05 | comment | added | Ali1S232 |
though I'm not big int part (caused by all div and mod parts), it sure works fast enough for int and long .
|
|
Jan 9, 2012 at 23:53 | history | answered | ratchet freak | CC BY-SA 3.0 |