expl: Work around inaccurate implementation on NetBSD.
[gnulib.git] / tests / test-jn.c
blob693a8b275baebf65e1d6e75ded1005ad08e84524
1 /* Test of jn() function.
2 Copyright (C) 2010-2019 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17 /* Written by Bruno Haible <bruno@clisp.org>, 2010. */
19 #include <config.h>
21 #include <math.h>
23 #include "signature.h"
24 SIGNATURE_CHECK (jn, double, (int, double));
26 #include "macros.h"
28 volatile double x;
29 double y;
31 int
32 main ()
34 /* A particular value. */
35 x = 3.8;
36 y = jn (0, x);
37 ASSERT (y >= -0.4025564102 && y <= -0.4025564101);
39 /* A particular value. */
40 x = 3.8;
41 y = jn (1, x);
42 ASSERT (y >= 0.0128210029 && y <= 0.0128210030);
44 /* A particular value. */
45 x = 3.8;
46 y = jn (2, x);
47 ASSERT (y >= 0.4093043064 && y <= 0.4093043065);
49 /* A particular value. */
50 x = 3.8;
51 y = jn (3, x);
52 ASSERT (y >= 0.4180256354 && y <= 0.4180256355);
54 /* A particular value. */
55 x = 3.8;
56 y = jn (4, x);
57 ASSERT (y >= 0.2507361705 && y <= 0.2507361706);
59 /* A particular value. */
60 x = 3.8;
61 y = jn (5, x);
62 ASSERT (y >= 0.1098399867 && y <= 0.1098399868);
64 /* A particular value. */
65 x = 3.8;
66 y = jn (6, x);
67 ASSERT (y >= 0.0383164262 && y <= 0.0383164263);
69 /* A particular value. */
70 x = 3.8;
71 y = jn (7, x);
72 ASSERT (y >= 0.0111592540 && y <= 0.0111592541);
74 /* A particular value. */
75 x = 3.8;
76 y = jn (8, x);
77 ASSERT (y >= 0.0027966149 && y <= 0.0027966150);
79 /* A particular value. */
80 x = 3.8;
81 y = jn (9, x);
82 ASSERT (y >= 0.0006159669 && y <= 0.0006159670);
84 /* A particular value. */
85 x = 3.8;
86 y = jn (10, x);
87 ASSERT (y >= 0.0001211233 && y <= 0.0001211234);
89 return 0;