At 3/18/09 12:05 PM, El-Presidente wrote: Re: Binary Numbahz
At 3/18/09 11:29 AM, Glaiel-Gamer wrote: powers of two (2, 4, 8, 16, 32, 64, ...) are more efficient than other numbersJust out of curiosity, what else does that apply for? I'm just going to make a wild assumption it's because of their binary numbers [10, 100, 1000, 10000, etc.], but I have no idea how some of this shit works, so I could be entirely wrong.
Multiplication/Division by a power of two can be performed by the processor as a bit-shift instead of a multiplication (assuming it knows ahead of time that it's multiplying/dividing by two, usually a compiler determines that)
Bit-shift is much faster than multiplication