The sample program given in the manual page for the gamma function is wrong, partly because the manual page is ambiguous. The value of signgam is not ==0 or !=0, it is >0 or <0. So the if in the program should read "if (signgam < 0)" not "if (signgam)".