annotate tests/test-lgamma.c @ 16364:89227b989588

fatal-signal: use C prototypes (with explicit void). * lib/fatal-signal.c (uninstall_handlers, install_handlers) (init_fatal_signal_set, block_fatal_signals): Fix signatures.
author Akim Demaille <demaille@gostai.com>
date Wed, 08 Feb 2012 10:36:20 +0100
parents 8250f2777afc
children e542fd46ad6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12796
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of lgamma() function.
16201
8250f2777afc maint: update all copyright year number ranges
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
2 Copyright (C) 2010-2012 Free Software Foundation, Inc.
12796
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2010. */
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <math.h>
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include "signature.h"
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 SIGNATURE_CHECK (lgamma, double, (double));
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include "macros.h"
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 volatile double x;
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 double y;
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 int
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 main ()
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 {
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 /* A particular value. */
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 x = 0.6;
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 y = lgamma (x);
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 /* Γ(x) = 1.4891922488... */
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 ASSERT (y >= 0.3982338580 && y <= 0.3982338581);
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 return 0;
51cdbee6290c Tests for module 'lgamma'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 }