For integer parameters greater than 6, tgamma(n+1) != n! (note: 719 and beyond are off-by-one, while the real parameter at the bottom results in 720) #include <iostream> #include <cmath> using namespace std; int main(void) { uint64_t foo; for(int i=0; i < 10; i++) { foo = tgamma(i); cout << foo << "\n"; } cout << tgamma(7.0) << "\n"; } 0 1 1 2 6 24 120 719 5039 40319 720
Apologies, this is not a bug as I misread the return types supported to include integers when they don't.
tgamma(7) correctly returns 719.9999...