MCPcopy Create free account
hub / github.com/RenderKit/embree / FloorLog2

Function FloorLog2

tutorials/common/image/tinyexr.h:5548–5558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5546
5547
5548static int FloorLog2(unsigned x) {
5549 //
5550 // For x > 0, floorLog2(y) returns floor(log(x)/log(2)).
5551 //
5552 int y = 0;
5553 while (x > 1) {
5554 y += 1;
5555 x >>= 1u;
5556 }
5557 return y;
5558}
5559
5560
5561static int CeilLog2(unsigned x) {

Callers 1

RoundLog2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected