11 Jun
2008
11 Jun
'08
8:25 a.m.
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 :-( John.