Skip to content

Instantly share code, notes, and snippets.

@FlorianBELLAZOUZ
Created April 13, 2017 06:12
Show Gist options
  • Save FlorianBELLAZOUZ/8c0d81cc66e246a74798f38c43bc7258 to your computer and use it in GitHub Desktop.
Save FlorianBELLAZOUZ/8c0d81cc66e246a74798f38c43bc7258 to your computer and use it in GitHub Desktop.
Get the bitsize of a int 32bits
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