bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] bug in gsl_sf_choose ?


From: Eldon, Bjarki
Subject: [Bug-gsl] bug in gsl_sf_choose ?
Date: Tue, 2 Aug 2016 12:34:47 +0000

Dear GSL,

I'm using GSL  version 1.16-5.1.3 on  openSUSE-13.2-Oss  on x86_64 arch.


the C code  below  returns a lot of 1s; is there a bug in gsl_sf_choose or am I 
doing something wrong?

best regards
bjarki


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_sf_elementary.h>
#include <gsl/gsl_sf_gamma.h>
#include <gsl/gsl_sf_exp.h>



int main()
{
  unsigned int n ;
  int nchoosetwo ;

  for( n = 2 ; n <= 102 ; n++){
    nchoosetwo = (int) ( ( (double)( n*(n-1)) )/2. ) ;

    printf( "%d:  %d\n", n, (nchoosetwo != (int)gsl_sf_choose( n,2)) ? 1 : 0 ); 
}

  return GSL_SUCCESS;

}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]