Sergey Shandar<p><a href="https://techhub.social/tags/JavaScript" class="mention hashtag" rel="tag">#<span>JavaScript</span></a> is a weird language; it has <a href="https://techhub.social/tags/bigint" class="mention hashtag" rel="tag">#<span>bigint</span></a>, but it doesn't have a function that returns a number of bits in the bigint. Neither it has <a href="https://techhub.social/tags/log2" class="mention hashtag" rel="tag">#<span>log2</span></a> function for the bigints. If you need a workaround for the problem, see the article <a href="https://medium.com/@sergeyshandar/improving-the-log2-algorithm-for-bigint-in-javascript-7e5692e7bf0b?sk=9ac18367f61b524704cc8d82707aed3d" target="_blank" rel="nofollow noopener noreferrer" translate="no"><span class="invisible">https://</span><span class="ellipsis">medium.com/@sergeyshandar/impr</span><span class="invisible">oving-the-log2-algorithm-for-bigint-in-javascript-7e5692e7bf0b?sk=9ac18367f61b524704cc8d82707aed3d</span></a></p>