Number of Bits Needed to Represent a Zero-Offset Integer

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Feb 13 11:54:32 PST 2015


On Friday, 13 February 2015 at 15:14:44 UTC, H. S. Teoh wrote:
> Isn't it essentially floor(log_2(a)), mathematically speaking? 
> Maybe
> that could be the basis of a better name?

integer log2:
https://graphics.stanford.edu/~seander/bithacks.html#IntegerLogFloat




More information about the Digitalmars-d-learn mailing list