summaryrefslogtreecommitdiff
path: root/libgfortran/intrinsics/c99_functions.c
diff options
context:
space:
mode:
authorbdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-14 17:27:20 +0000
committerbdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-14 17:27:20 +0000
commit79202f2e976577d975f270d60db53881bf7ff6ac (patch)
tree3999fa2fb387b4492c2311669e6e057592060f00 /libgfortran/intrinsics/c99_functions.c
parent366090281a8c5c05f6ce25f3f8e26b29e2209f4d (diff)
downloadgcc-79202f2e976577d975f270d60db53881bf7ff6ac.tar.gz
2004-06-14 Bud Davis <bdavis9659@comcast.net>
PR gfortran/15292 * intrinsics/c99_functions.c: Use fpclassify if it exists. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83116 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/intrinsics/c99_functions.c')
-rw-r--r--libgfortran/intrinsics/c99_functions.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c
index 932838780b8..69b6c3e2e96 100644
--- a/libgfortran/intrinsics/c99_functions.c
+++ b/libgfortran/intrinsics/c99_functions.c
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
#include "libgfortran.h"
+/* Note that if HAVE_FPCLASSIFY is not defined, then NaN is not handled */
+
/* Algorithm by Steven G. Kargl. */
#ifndef HAVE_ROUND
@@ -34,11 +36,12 @@ double
round(double x)
{
double t;
+#ifdef HAVE_FPCLASSIFY
int i;
-
i = fpclassify(x);
if (i == FP_INFINITE || i == FP_NAN)
return (x);
+#endif
if (x >= 0.0)
{
@@ -65,11 +68,13 @@ float
roundf(float x)
{
float t;
+#ifdef HAVE_FPCLASSIFY
int i;
i = fpclassify(x);
if (i == FP_INFINITE || i == FP_NAN)
return (x);
+#endif
if (x >= 0.0)
{