/// \file /// \ingroup tutorial_math /// \notebook -nodraw /// tutorial illustrating the use of TMath::Binomial /// can be run with: /// /// ~~~{.cpp} /// root > .x binomial.C /// root > .x binomial.C+ with ACLIC /// ~~~ /// /// \macro_output /// \macro_code /// /// \author Federico Carminati #include #include void binomialSimple() { // // Simple test for the binomial distribution // printf("\nTMath::Binomial simple test\n"); printf("Build the Tartaglia triangle\n"); printf("============================\n"); const Int_t max=13; Int_t j; for(Int_t i=0;i1e-10) printf("res1=%e res2=%e x=%e y=%e err=%e j=%d\n",res1,res2,x,y,err,j); serr +=err; } } printf("Average Error = %e\n",serr/nmax); } void binomial () { binomialSimple(); binomialFancy(); }