annotate lib/isnanf-nolibm.h @ 17814:f50001a9c124

autoupdate
author Karl Berry <karl@freefriends.org>
date Wed, 03 Dec 2014 07:04:40 -0800
parents 344018b6e5d7
children ab58d4870664
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10264
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
1 /* Test for NaN that does not need libm.
17587
344018b6e5d7 maint: update copyright
Eric Blake <eblake@redhat.com>
parents: 17249
diff changeset
2 Copyright (C) 2007-2014 Free Software Foundation, Inc.
10264
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
3
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
7 (at your option) any later version.
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
8
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
12 GNU General Public License for more details.
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
13
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
16
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
17 #if HAVE_ISNANF_IN_LIBC
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
18 /* Get declaration of isnan macro or (older) isnanf function. */
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
19 # include <math.h>
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
20 # if __GNUC__ >= 4
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
21 /* GCC 4.0 and newer provides three built-ins for isnan. */
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
22 # undef isnanf
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
23 # define isnanf(x) __builtin_isnanf ((float)(x))
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
24 # elif defined isnan
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
25 # undef isnanf
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
26 # define isnanf(x) isnan ((float)(x))
16646
e0066a03e708 isnanf-nolibm: Make it work on IRIX 6.5 with cc.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
27 # else
e0066a03e708 isnanf-nolibm: Make it work on IRIX 6.5 with cc.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
28 /* Get declaration of isnanf(), if not declared in <math.h>. */
e0066a03e708 isnanf-nolibm: Make it work on IRIX 6.5 with cc.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
29 # if defined __sgi
16647
c7d27bd249a7 isnanf-nolibm: Fix last commit.
Bruno Haible <bruno@clisp.org>
parents: 16646
diff changeset
30 /* We can't include <ieeefp.h>, because it conflicts with our definition of
c7d27bd249a7 isnanf-nolibm: Fix last commit.
Bruno Haible <bruno@clisp.org>
parents: 16646
diff changeset
31 isnand. Therefore declare isnanf separately. */
c7d27bd249a7 isnanf-nolibm: Fix last commit.
Bruno Haible <bruno@clisp.org>
parents: 16646
diff changeset
32 extern int isnanf (float x);
16646
e0066a03e708 isnanf-nolibm: Make it work on IRIX 6.5 with cc.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
33 # endif
10264
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
34 # endif
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
35 #else
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
36 /* Test whether X is a NaN. */
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
37 # undef isnanf
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
38 # define isnanf rpl_isnanf
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
39 extern int isnanf (float x);
ebb7ea0c94e8 Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
diff changeset
40 #endif