Re: implementation note for scapegoat tree
- From: Ben Pfaff <blp@xxxxxxxxxxxxxxx>
- Date: Thu, 29 Mar 2007 12:58:56 -0700
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
.
- References:
- implementation note for scapegoat tree
- From: Ben Pfaff
- Re: implementation note for scapegoat tree
- From: Hallvard B Furuseth
- implementation note for scapegoat tree
- Prev by Date: Re: computing the moment of inertia
- Next by Date: Combination of binary variables
- Previous by thread: Re: implementation note for scapegoat tree
- Next by thread: bison and valgrind
- Index(es):
Relevant Pages
|