Is there a neater way for getting the number of digits in an int than this method?
int numDigits = String.valueOf(1000).length();
Using Java
int nDigits = Math.floor(Math.log10(Math.abs(the_integer))) + 1;
use import java.lang.Math.*; in the beginning
import java.lang.Math.*;
Using C
int nDigits = floor(log10(abs(the_integer))) + 1;
use inclue math.h in the beginning
inclue math.h