문제

I am trying to use tgamma() from the standard library. When I try to compile, I get the error message:

Call to undefined function tgamma

I have the directive #include <cmath>. I use Embarcadero C++ Builder XE3, which claims to support C++11 standards. What could be my problem, and how to fix it?

도움이 되었습니까?

해결책

Boost contains a tgamma function.

#include <boost/math/special_functions/gamma.hpp>
...
double rootPi = boost::math::tgamma<double>(0.5);

Of course, you can always switch to a different compiler, like gcc.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top