MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Log2Floor64

Function Log2Floor64

tensorflow/core/lib/strings/ordered_code.cc:414–416  ·  view source on GitHub ↗

Returns floor(lg(n)). Returns -1 if n == 0.

Source from the content-addressed store, hash-verified

412#if defined(__GNUC__)
413// Returns floor(lg(n)). Returns -1 if n == 0.
414static int Log2Floor64(uint64 n) {
415 return n == 0 ? -1 : 63 ^ __builtin_clzll(n);
416}
417#else
418// Portable slow version
419static int Log2Floor32_Portable(uint32 n) {

Callers 2

SignedEncodingLengthFunction · 0.70

Calls 1

Log2Floor32_PortableFunction · 0.85

Tested by

no test coverage detected