X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 10 Oct 2007 23:27:59 +0200 From: Angelo Graziosi To: cygwin AT cygwin DOT com Subject: A problem wit tgamma function Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com For the sake of completeness I want to flag this. A recent failure of GFortran tests, regarding the usage of GAMMA functions, results in the following problem with 'tgamma' on Cygwin (gcc-3.4.4-3): ============================================================= /* gcc --std=c99 test_tgamma.c -lm && ./a.out */ #include #include #define N_MAX 34 #undef M_PI #define M_PI 3.14159265358979323846 int main() { float c[N_MAX+1]; float xs, ts; float diff; int i; c[0] = 1.; for (i=1; i<=N_MAX; i++) c[i] = (2*i-1)*c[i-1]*0.5; for (i=1; i<=N_MAX; i++) { xs = i + 0.5f; /* argument to the gamma function */ ts = c[i] * sqrtf(M_PI); diff = fabsf(tgammaf(xs)-ts)/ts; if (diff > 1e-6) printf("Arg: %g, Exact: %12.8g, tgamma: %12.8g, diff: %12.8g\n", xs, ts, tgammaf(xs), diff); } return 0; } ============================================================= $ ./a.exe Segmentation fault (core dumped) Cheers, Angelo. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/