Created
December 27, 2016 03:17
-
-
Save fiftin/00b8ab7182ae8190e64b742a56a57063 to your computer and use it in GitHub Desktop.
Number of digits
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
function numDigits(x) { | |
return (Math.log10((x ^ (x >> 31)) - (x >> 31)) | 0) + 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment