Number of Bits Needed to Represent a Zero-Offset Integer

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Feb 13 14:00:45 PST 2015


On Fri, Feb 13, 2015 at 07:54:32PM +0000, via Digitalmars-d-learn wrote:
> 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

So it could be called ilog2?


T

-- 
Being able to learn is a great learning; being able to unlearn is a greater learning.


More information about the Digitalmars-d-learn mailing list