FRANKLIN
Wednesday, 18 September 2013
Log base n of x
Log base n of x
I have a little problem. who knows how we can calculate the log base n (2
for example: for n=2 we had this solution:
int log(int n){
int res = 0;
while((n>>=1))
res++;
return res;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
View mobile version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment