MPFRCPP Bugs

#1: cmath.tcc:41: error: no match for ternary 'operator?:'

(http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31511)

Your g++ compiler says something like this:

/usr/include/c++/bits/cmath.tcc:41: error: no match for
ternary 'operator?:' in '((__n % 2u) != 0u) ? __x : 1'

It is known problem with GNU ISO C++ Library math implementation by Gabriel Dos Reis. You should find the certain line at the cmath.tcc file and replace code

_Tp __y = __n % 2 ? __x : 1;

with more correct

_Tp __y = __n % 2 ? __x : _Tp(1);

#2: lngamma(2) loop

Program loops while calculating

mpfrcpp::Lngamma (mpfrcpp::Real(2));

It's a MPFR core bug. It was fixed in MPFR 2.2.1.