11 Jun
2008
11 Jun
'08
8:25 a.m.
Sakaie, Ken wrote:
I did the following 'hello-world'-level test of the factorial function and get the following error.
cat test.cpp
#include "boost/math/special_functions/factorials.hpp" int main() { unsigned int i = 6; printf("%d\n", boost::math::factorial(i)); }
g++ -I/home/sakaiek/ext/src/boost_1_35_0/ test.cpp
test.cpp: In function 'int main()': test.cpp:5: error: no matching function for call to 'factorial(unsigned int&)'
Since the factorial function takes an integer argument and returns a floating point value, you need to tell the compiler what type of result you are expecting: boost::math::factorial<double>(6); The error message wasn't especially helpful though :-( HTH, John.