annotate tests/test-logbl.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
16756
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of logbl() function.
17587
344018b6e5d7 maint: update copyright
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
2 Copyright (C) 2010-2014 Free Software Foundation, Inc.
16756
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2010. */
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <math.h>
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include "signature.h"
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 SIGNATURE_CHECK (logbl, long double, (long double));
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include <float.h>
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #include "minus-zero.h"
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 #include "macros.h"
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 #define DOUBLE long double
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 #define VOLATILE
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 #define HUGEVAL HUGE_VALL
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 #define L_(literal) literal##L
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 #define MINUS_ZERO minus_zerol
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 #define MAX_EXP LDBL_MAX_EXP
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 #define MIN_EXP LDBL_MIN_EXP
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 /* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 exponent for 'long double' is -964. Similarly, on PowerPC machines,
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double'
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 is -968. For exponents below that, the precision may be truncated to the
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 precision used for 'double'. */
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 #ifdef __sgi
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 57)
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 #elif defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53)
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 #else
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 # define MIN_NORMAL_EXP LDBL_MIN_EXP
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 #endif
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 #define LOGB logbl
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 #define RANDOM randoml
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 #include "test-logb.h"
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 int
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 main ()
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 {
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 test_function ();
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 return 0;
1b46a10c875f Tests for module 'logbl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 }