annotate lib/log10.c @ 17463:203c036eb0c6

bootstrap: support checksum utils without a --status option * build-aux/bootstrap: Only look for sha1sum if updating po files. Add sha1 to the list of supported checksum utils since it's now supported through adjustments below. (update_po_files): Remove the use of --status in a way that will suppress all error messages, but since this is only used to minimize updates, it shouldn't cause an issue. Exit early if there is a problem updating the po file checksums. (find_tool): Remove the check for --version support as this is optional as per commit 86186b17. Don't even check for the presence of the command as if that is needed, it's supported through configuring prerequisites in bootstrap.conf. Prompt that when a tool isn't found, one can define an environment variable to add to the hardcoded search list.
author Pádraig Brady <P@draigBrady.com>
date Thu, 08 Aug 2013 11:08:49 +0100 (2013-08-08)
parents e542fd46ad6f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16736
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Base 10 logarithmic function.
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16745
diff changeset
2 Copyright (C) 2012-2013 Free Software Foundation, Inc.
16736
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 #include <config.h>
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 /* Specification. */
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 #include <math.h>
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 double
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 log10 (double x)
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 #undef log10
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 {
16745
78fe2a20b15c log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents: 16736
diff changeset
26 if (x <= 0.0)
78fe2a20b15c log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents: 16736
diff changeset
27 {
78fe2a20b15c log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents: 16736
diff changeset
28 /* Work around the OSF/1 5.1 bug. */
78fe2a20b15c log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents: 16736
diff changeset
29 if (x == 0.0)
78fe2a20b15c log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents: 16736
diff changeset
30 /* Return -Infinity. */
78fe2a20b15c log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents: 16736
diff changeset
31 return -1.0 / 0.0;
78fe2a20b15c log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents: 16736
diff changeset
32 /* Work around the NetBSD 5.1, Solaris 11 2011-11 bug. */
78fe2a20b15c log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents: 16736
diff changeset
33 else /* x < 0.0 */
78fe2a20b15c log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents: 16736
diff changeset
34 /* Return NaN. */
78fe2a20b15c log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents: 16736
diff changeset
35 return 0.0 / 0.0;
78fe2a20b15c log10-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents: 16736
diff changeset
36 }
16736
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 return log10 (x);
747e0285fa98 log10: Work around OSF/1 5.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 }