Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top