Alg-Code
Pages
Home
C++ String Example
Welcome~~~
This blog:
http://alg-code.blogspot.com/
Another blog:
http://fun-st.blogspot.com/
It is easier to write an incorrect program than understand a correct one.
Friday, April 1, 2011
# Find the number of digits in n!.
number of digits in n = floor(log(n)) + 1;
so for n! # of digits = (floor(log(n!)))+1;
= floor(Sum of log1+log2+--- + logn)+1;
digits = (int) log10(number), where log 10 means log for base 10
--
♥ ¸¸.•*¨*•♫♪♪♫•*¨*•.¸¸♥
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment