Mercurial > hg > octave-nkf > gnulib-hg
annotate lib/log.c @ 17587:344018b6e5d7
maint: update copyright
I ran 'make update-copyright'.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Wed, 01 Jan 2014 00:04:40 -0700 |
parents | e542fd46ad6f |
children | ab58d4870664 |
rev | line source |
---|---|
16631 | 1 /* Logarithm. |
17587 | 2 Copyright (C) 2012-2014 Free Software Foundation, Inc. |
16631 | 3 |
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. | |
8 | |
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. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
16 | |
17 #include <config.h> | |
18 | |
19 /* Specification. */ | |
20 #include <math.h> | |
21 | |
22 double | |
23 log (double x) | |
24 #undef log | |
25 { | |
16643
90bb29c30680
log-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents:
16631
diff
changeset
|
26 if (x <= 0.0) |
90bb29c30680
log-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents:
16631
diff
changeset
|
27 { |
90bb29c30680
log-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents:
16631
diff
changeset
|
28 /* Work around the OSF/1 5.1 bug. */ |
90bb29c30680
log-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents:
16631
diff
changeset
|
29 if (x == 0.0) |
90bb29c30680
log-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents:
16631
diff
changeset
|
30 /* Return -Infinity. */ |
90bb29c30680
log-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents:
16631
diff
changeset
|
31 return -1.0 / 0.0; |
90bb29c30680
log-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents:
16631
diff
changeset
|
32 /* Work around the NetBSD 5.1, Solaris 11 2011-11 bug. */ |
90bb29c30680
log-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents:
16631
diff
changeset
|
33 else /* x < 0.0 */ |
90bb29c30680
log-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents:
16631
diff
changeset
|
34 /* Return NaN. */ |
90bb29c30680
log-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents:
16631
diff
changeset
|
35 return 0.0 / 0.0; |
90bb29c30680
log-ieee: Work around test failure on NetBSD 5.1 and Solaris 11.
Bruno Haible <bruno@clisp.org>
parents:
16631
diff
changeset
|
36 } |
16631 | 37 return log (x); |
38 } |