home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,541 of 33,346   
   Martin Bonner to TheGunslinger   
   Re: Probability Methods - Factorial   
   17 Sep 12 11:46:50   
   
   From: martinfrompi@yahoo.co.uk   
      
   On Saturday, September 15, 2012 11:02:10 PM UTC+1, TheGunslinger wrote:   
      
   > I want to implement the use of '!' for recognizing and calculating   
   > the factorial of a number, n.   
   >   
   > I am unable to find a reference to this as being a standard call   
   > within C++.   
   >   
   > Is it contained within a specific library? Or do I, instead, need to   
   > implement an my own algorithm for this?   
   >   
   > I cannot believe it is not included in an STL someplace?   
      
   The problem is that even 13! is not guaranteed to fit into a long.  To   
   represent the results of a factorial expression, you are going to need   
   a bignum library; (almost) any bignum library will have a factorial   
   function.   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca