Improving the Log2 Algorithm for BigInt in JavaScript

JavaScript is a weird programming language. I usually use the bigint type as a vector of bits and often need to know how many bits are in a…