Boost logo

Boost Users :

From: John Maddock (jz.maddock_at_[hidden])
Date: 2008-06-11 04:25:02

Steven Watanabe wrote:
> Here's one way:
> #include "boost/math/special_functions/factorials.hpp"
> int main()
> {
> unsigned int i = 6;
> printf("%d\n",
> static_cast<unsigned>(boost::math::factorial<double>(i)));
> }

Ah, yes I missed that he was formatting the result as an integer: note that
there are *very few* factorials that will fit inside an integer result, so
this isn't really safe :-(


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at