Thread: counting digits
View Single Post
Old Apr 10th, 2007, 10:57 AM   #6
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
ok so this works:

//number of digits
inline int num_digits(int num) {
	return ceil(log10(num));
}

but lots of warnings! :/

thanks guys!
rwm is offline   Reply With Quote