Created
April 13, 2017 06:12
-
-
Save FlorianBELLAZOUZ/8c0d81cc66e246a74798f38c43bc7258 to your computer and use it in GitHub Desktop.
Get the bitsize of a int 32bits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bitSize = num=>num===0?1:Math.floor(Math.log(num)/Math.log(2))+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment