Program to find factorial of 100

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shashank kumar mittal
    New Member
    • Oct 2009
    • 1

    Program to find factorial of 100

    Please tell me how to find factorial of 100 in c++
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    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

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      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

      Working...