problem with gsl_sf_lnpoch

Giulio Bottazzi giulio.bottazzi@libero.it
Fri Sep 29 17:01:00 GMT 2006


Hi,
It seems that the exponential of the logarithm of the Pochhammer symbol
with second argument equal to zero is NOT one. Consider the following
little program, which should print two times the number 1 separated by
a space

/* -- START test.c */
#include <stdio.h>
#include <math.h>
#include <gsl/gsl_sf_gamma.h>
int main(){

  printf("exp(log(poch))=%g poch=%g\n",
        exp( gsl_sf_lnpoch(7,0)),gsl_sf_poch(7,0));

  return 0;
}
/* -- END test.c */

If I compile it with
#gcc -Wall test.c -lgsl -lgslcblas -lm -o test
and run
#./test
I get:
#exp(log(poch))=2.71828 poch=1

What's going on? I can't see any mistake in my code.

Best,
	Giulio.


--
Giulio Bottazzi                       PGP Key ID:BAB0A33F
giulio.bottazzi@libero.it   http://www.sssup.it/~bottazzi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gsl-discuss/attachments/20060929/2766ae2e/attachment.sig>


More information about the Gsl-discuss mailing list