Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
Program to find factorial of 100
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
shashank kumar mittal
New Member
Join Date:
Oct 2009
Posts:
1
#1
Program to find factorial of 100
Oct 15 '09, 12:09 PM
Please tell me how to find factorial of 100 in c++
Banfa
Recognized Expert
Expert
Join Date:
Feb 2006
Posts:
9067
#2
Oct 15 '09, 12:32 PM
Get a library that has a class that supports unlimited precision integers.
Do the calculation in the normal way.
You might try looking at the Boost library that is the sort of thing that they make.
Comment
Post
Cancel
donbock
Recognized Expert
Top Contributor
Join Date:
Mar 2008
Posts:
2427
#3
Oct 15 '09, 06:03 PM
According to Microsoft Excel:
100! = FACT(100) = 9.3 x 10^157
log-base-2(100!) = LOG(FACT(100),2 ) = 524.8
That is, you need 526-bit integer math to compute the factorial of 100.
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment