Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Thomas Smith
Added: May 7, 2018 11:38 PM
Views: 20
Tags: no tags
Calculate the number of digits in an integer number of base-10
  1. private static int numOfDigits(int x)
  2. {
  3.         return 1 + (int)(Math.log10(x));
  4. }