Re: implementation note for scapegoat tree



Hallvard B Furuseth <h.b.furuseth@xxxxxxxxxxx> writes:

Ben Pfaff writes:
floor_log2 (size_t x)
{
return sizeof (size_t) * CHAR_BIT - 1 - count_leading_zeros (x);
}

Wrong if size_t has padding bits.

I'm ignoring that possibility. (Note that this is
comp.programming, not comp.lang.c.)
--
Ben Pfaff
http://benpfaff.org
.



Relevant Pages

  • Re: size_t or int for malloc-type functions?
    ... Ben Pfaff wrote: ... void *result; ... Ignoring the casts, maybe ...
    (comp.lang.c)
  • Re: value bits
    ... Hallvard B Furuseth wrote: ... > Zack Weinberg wrote: ... That counts padding bits as well. ... Is it possible to have a similar macro that works for all ...
    (comp.lang.c)
  • Re: CSS Tables Formatting Problem
    ... My guess is that the browser is ignoring the percentage when it computes ... Suggested workaround is not to use a percentage padding there-- if I ... were working on Firefox then I'd fix the bug by ignoring the percentage ... So just set padding to 0.5em or something instead. ...
    (comp.infosystems.www.authoring.stylesheets)