annotate tests/test-cbrt.c @ 17632:86af85d364e1 default tip

unistd: port readlink to Mac OS X 10.3.9 * lib/unistd.in.h (_GL_INCLUDING_UNISTD_H): New macro, to work around self-include problem in Mac OS X 10.3.9 when combined with readlink module. Problem reported by Klaus Zietler in <http://bugs.gnu.org/16825>.
author Paul Eggert <eggert@penguin.cs.ucla.edu>
date Tue, 25 Feb 2014 11:16:27 -0800
parents 344018b6e5d7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12782
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of cbrt() function.
17587
344018b6e5d7 maint: update copyright
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
2 Copyright (C) 2010-2014 Free Software Foundation, Inc.
12782
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2010. */
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <math.h>
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include "signature.h"
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 SIGNATURE_CHECK (cbrt, double, (double));
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
16575
2faf2762788a cbrt* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
26 #include <float.h>
2faf2762788a cbrt* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
27
12782
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #include "macros.h"
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29
16575
2faf2762788a cbrt* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
30 #define DOUBLE double
2faf2762788a cbrt* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
31 #define L_(literal) literal
2faf2762788a cbrt* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
32 #define MANT_DIG DBL_MANT_DIG
2faf2762788a cbrt* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
33 #define CBRT cbrt
2faf2762788a cbrt* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
34 #define RANDOM randomd
2faf2762788a cbrt* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
35 #include "test-cbrt.h"
12782
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 int
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 main ()
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 {
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 /* A particular value. */
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 x = 0.6;
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 y = cbrt (x);
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 ASSERT (y >= 0.8434326653 && y <= 0.8434326654);
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44
16575
2faf2762788a cbrt* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
45 test_function ();
2faf2762788a cbrt* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
46
12782
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 return 0;
e01dd71f171d Tests for module 'cbrt'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 }