سؤال

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