summaryrefslogtreecommitdiffstats
path: root/newlib/libm/math
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libm/math')
-rw-r--r--newlib/libm/math/Makefile.am12
-rw-r--r--newlib/libm/math/Makefile.in61
-rw-r--r--newlib/libm/math/math.tex2
-rw-r--r--newlib/libm/math/s_isinf.c26
-rw-r--r--newlib/libm/math/s_isnan.c122
-rw-r--r--newlib/libm/math/sf_isinf.c33
-rw-r--r--newlib/libm/math/sf_isnan.c47
7 files changed, 272 insertions, 31 deletions
diff --git a/newlib/libm/math/Makefile.am b/newlib/libm/math/Makefile.am
index f5971fac9..4b4db93d8 100644
--- a/newlib/libm/math/Makefile.am
+++ b/newlib/libm/math/Makefile.am
@@ -22,9 +22,10 @@ src = k_standard.c k_rem_pio2.c \
w_cabs.c w_drem.c \
s_asinh.c s_atan.c s_ceil.c \
s_cos.c s_erf.c s_fabs.c s_floor.c \
- s_frexp.c s_ldexp.c \
+ s_frexp.c s_isnan.c s_ldexp.c \
s_signif.c s_sin.c \
s_tan.c s_tanh.c \
+ s_isinf.c \
w_exp2.c w_tgamma.c
fsrc = kf_rem_pio2.c \
@@ -45,9 +46,10 @@ fsrc = kf_rem_pio2.c \
wf_cabs.c wf_drem.c \
sf_asinh.c sf_atan.c sf_ceil.c \
sf_cos.c sf_erf.c sf_fabs.c sf_floor.c \
- sf_frexp.c sf_ldexp.c \
+ sf_frexp.c sf_isnan.c sf_ldexp.c \
sf_signif.c sf_sin.c \
sf_tan.c sf_tanh.c \
+ sf_isinf.c \
wf_exp2.c wf_tgamma.c
libmath_la_LDFLAGS = -Xcompiler -nostdlib
@@ -71,7 +73,8 @@ chobj = wacos.def wacosh.def wasin.def sasinh.def \
wgamma.def whypot.def sldexp.def wlog.def \
wlog10.def \
wpow.def wremainder.def ssin.def wsinh.def \
- wsqrt.def stan.def stanh.def
+ wsqrt.def stan.def stanh.def \
+ sisnan.def
SUFFIXES = .def
@@ -175,6 +178,9 @@ stan.def: s_tan.c
stanh.def: s_tanh.c
$(CHEW) < $(srcdir)/s_tanh.c >$@ 2>/dev/null
touch stmp-def
+sisnan.def: s_isnan.c
+ $(CHEW) < $(srcdir)/s_isnan.c >$@ 2>/dev/null
+ touch stmp-def
# A partial dependency list.
diff --git a/newlib/libm/math/Makefile.in b/newlib/libm/math/Makefile.in
index f00e189c7..1de8a5398 100644
--- a/newlib/libm/math/Makefile.in
+++ b/newlib/libm/math/Makefile.in
@@ -98,10 +98,10 @@ AUTOMAKE_OPTIONS = cygnus
INCLUDES = -I$(srcdir)/../common $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-src = k_standard.c k_rem_pio2.c k_cos.c k_sin.c k_tan.c e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c e_exp.c e_fmod.c er_gamma.c e_hypot.c e_j0.c e_j1.c e_jn.c er_lgamma.c e_log.c e_log10.c e_pow.c e_rem_pio2.c e_remainder.c e_scalb.c e_sinh.c e_sqrt.c w_acos.c w_acosh.c w_asin.c w_atan2.c w_atanh.c w_cosh.c w_exp.c w_fmod.c w_gamma.c wr_gamma.c w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c wr_lgamma.c w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c w_sqrt.c w_sincos.c w_cabs.c w_drem.c s_asinh.c s_atan.c s_ceil.c s_cos.c s_erf.c s_fabs.c s_floor.c s_frexp.c s_ldexp.c s_signif.c s_sin.c s_tan.c s_tanh.c w_exp2.c w_tgamma.c
+src = k_standard.c k_rem_pio2.c k_cos.c k_sin.c k_tan.c e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c e_exp.c e_fmod.c er_gamma.c e_hypot.c e_j0.c e_j1.c e_jn.c er_lgamma.c e_log.c e_log10.c e_pow.c e_rem_pio2.c e_remainder.c e_scalb.c e_sinh.c e_sqrt.c w_acos.c w_acosh.c w_asin.c w_atan2.c w_atanh.c w_cosh.c w_exp.c w_fmod.c w_gamma.c wr_gamma.c w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c wr_lgamma.c w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c w_sqrt.c w_sincos.c w_cabs.c w_drem.c s_asinh.c s_atan.c s_ceil.c s_cos.c s_erf.c s_fabs.c s_floor.c s_frexp.c s_isnan.c s_ldexp.c s_signif.c s_sin.c s_tan.c s_tanh.c s_isinf.c w_exp2.c w_tgamma.c
-fsrc = kf_rem_pio2.c kf_cos.c kf_sin.c kf_tan.c ef_acos.c ef_acosh.c ef_asin.c ef_atan2.c ef_atanh.c ef_cosh.c ef_exp.c ef_fmod.c erf_gamma.c ef_hypot.c ef_j0.c ef_j1.c ef_jn.c erf_lgamma.c ef_log.c ef_log10.c ef_pow.c ef_rem_pio2.c ef_remainder.c ef_scalb.c ef_sinh.c ef_sqrt.c wf_acos.c wf_acosh.c wf_asin.c wf_atan2.c wf_atanh.c wf_cosh.c wf_exp.c wf_fmod.c wf_gamma.c wrf_gamma.c wf_hypot.c wf_j0.c wf_j1.c wf_jn.c wf_lgamma.c wrf_lgamma.c wf_log.c wf_log10.c wf_pow.c wf_remainder.c wf_scalb.c wf_sinh.c wf_sqrt.c wf_sincos.c wf_cabs.c wf_drem.c sf_asinh.c sf_atan.c sf_ceil.c sf_cos.c sf_erf.c sf_fabs.c sf_floor.c sf_frexp.c sf_ldexp.c sf_signif.c sf_sin.c sf_tan.c sf_tanh.c wf_exp2.c wf_tgamma.c
+fsrc = kf_rem_pio2.c kf_cos.c kf_sin.c kf_tan.c ef_acos.c ef_acosh.c ef_asin.c ef_atan2.c ef_atanh.c ef_cosh.c ef_exp.c ef_fmod.c erf_gamma.c ef_hypot.c ef_j0.c ef_j1.c ef_jn.c erf_lgamma.c ef_log.c ef_log10.c ef_pow.c ef_rem_pio2.c ef_remainder.c ef_scalb.c ef_sinh.c ef_sqrt.c wf_acos.c wf_acosh.c wf_asin.c wf_atan2.c wf_atanh.c wf_cosh.c wf_exp.c wf_fmod.c wf_gamma.c wrf_gamma.c wf_hypot.c wf_j0.c wf_j1.c wf_jn.c wf_lgamma.c wrf_lgamma.c wf_log.c wf_log10.c wf_pow.c wf_remainder.c wf_scalb.c wf_sinh.c wf_sqrt.c wf_sincos.c wf_cabs.c wf_drem.c sf_asinh.c sf_atan.c sf_ceil.c sf_cos.c sf_erf.c sf_fabs.c sf_floor.c sf_frexp.c sf_isnan.c sf_ldexp.c sf_signif.c sf_sin.c sf_tan.c sf_tanh.c sf_isinf.c wf_exp2.c wf_tgamma.c
libmath_la_LDFLAGS = -Xcompiler -nostdlib
@@ -113,7 +113,7 @@ libmath_la_LDFLAGS = -Xcompiler -nostdlib
@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(src) $(fsrc)
-chobj = wacos.def wacosh.def wasin.def sasinh.def satan.def watan2.def watanh.def wj0.def wcosh.def serf.def wexp.def sfabs.def sfloor.def wfmod.def sfrexp.def wgamma.def whypot.def sldexp.def wlog.def wlog10.def wpow.def wremainder.def ssin.def wsinh.def wsqrt.def stan.def stanh.def
+chobj = wacos.def wacosh.def wasin.def sasinh.def satan.def watan2.def watanh.def wj0.def wcosh.def serf.def wexp.def sfabs.def sfloor.def wfmod.def sfrexp.def wgamma.def whypot.def sldexp.def wlog.def wlog10.def wpow.def wremainder.def ssin.def wsinh.def wsqrt.def stan.def stanh.def sisnan.def
SUFFIXES = .def
@@ -154,9 +154,10 @@ lib_a_LIBADD =
@USE_LIBTOOL_FALSE@w_cabs.$(OBJEXT) w_drem.$(OBJEXT) s_asinh.$(OBJEXT) \
@USE_LIBTOOL_FALSE@s_atan.$(OBJEXT) s_ceil.$(OBJEXT) s_cos.$(OBJEXT) \
@USE_LIBTOOL_FALSE@s_erf.$(OBJEXT) s_fabs.$(OBJEXT) s_floor.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@s_frexp.$(OBJEXT) s_ldexp.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@s_signif.$(OBJEXT) s_sin.$(OBJEXT) s_tan.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@s_tanh.$(OBJEXT) w_exp2.$(OBJEXT) w_tgamma.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@s_frexp.$(OBJEXT) s_isnan.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@s_ldexp.$(OBJEXT) s_signif.$(OBJEXT) s_sin.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@s_tan.$(OBJEXT) s_tanh.$(OBJEXT) s_isinf.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@w_exp2.$(OBJEXT) w_tgamma.$(OBJEXT) \
@USE_LIBTOOL_FALSE@kf_rem_pio2.$(OBJEXT) kf_cos.$(OBJEXT) \
@USE_LIBTOOL_FALSE@kf_sin.$(OBJEXT) kf_tan.$(OBJEXT) ef_acos.$(OBJEXT) \
@USE_LIBTOOL_FALSE@ef_acosh.$(OBJEXT) ef_asin.$(OBJEXT) \
@@ -184,9 +185,11 @@ lib_a_LIBADD =
@USE_LIBTOOL_FALSE@sf_atan.$(OBJEXT) sf_ceil.$(OBJEXT) sf_cos.$(OBJEXT) \
@USE_LIBTOOL_FALSE@sf_erf.$(OBJEXT) sf_fabs.$(OBJEXT) \
@USE_LIBTOOL_FALSE@sf_floor.$(OBJEXT) sf_frexp.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@sf_ldexp.$(OBJEXT) sf_signif.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@sf_sin.$(OBJEXT) sf_tan.$(OBJEXT) sf_tanh.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@wf_exp2.$(OBJEXT) wf_tgamma.$(OBJEXT)
+@USE_LIBTOOL_FALSE@sf_isnan.$(OBJEXT) sf_ldexp.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@sf_signif.$(OBJEXT) sf_sin.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@sf_tan.$(OBJEXT) sf_tanh.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@sf_isinf.$(OBJEXT) wf_exp2.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@wf_tgamma.$(OBJEXT)
LTLIBRARIES = $(noinst_LTLIBRARIES)
libmath_la_LIBADD =
@@ -203,24 +206,25 @@ libmath_la_LIBADD =
@USE_LIBTOOL_TRUE@w_remainder.lo w_scalb.lo w_sinh.lo w_sqrt.lo \
@USE_LIBTOOL_TRUE@w_sincos.lo w_cabs.lo w_drem.lo s_asinh.lo s_atan.lo \
@USE_LIBTOOL_TRUE@s_ceil.lo s_cos.lo s_erf.lo s_fabs.lo s_floor.lo \
-@USE_LIBTOOL_TRUE@s_frexp.lo s_ldexp.lo s_signif.lo s_sin.lo s_tan.lo \
-@USE_LIBTOOL_TRUE@s_tanh.lo w_exp2.lo w_tgamma.lo kf_rem_pio2.lo \
-@USE_LIBTOOL_TRUE@kf_cos.lo kf_sin.lo kf_tan.lo ef_acos.lo ef_acosh.lo \
-@USE_LIBTOOL_TRUE@ef_asin.lo ef_atan2.lo ef_atanh.lo ef_cosh.lo \
-@USE_LIBTOOL_TRUE@ef_exp.lo ef_fmod.lo erf_gamma.lo ef_hypot.lo \
-@USE_LIBTOOL_TRUE@ef_j0.lo ef_j1.lo ef_jn.lo erf_lgamma.lo ef_log.lo \
-@USE_LIBTOOL_TRUE@ef_log10.lo ef_pow.lo ef_rem_pio2.lo ef_remainder.lo \
-@USE_LIBTOOL_TRUE@ef_scalb.lo ef_sinh.lo ef_sqrt.lo wf_acos.lo \
-@USE_LIBTOOL_TRUE@wf_acosh.lo wf_asin.lo wf_atan2.lo wf_atanh.lo \
-@USE_LIBTOOL_TRUE@wf_cosh.lo wf_exp.lo wf_fmod.lo wf_gamma.lo \
-@USE_LIBTOOL_TRUE@wrf_gamma.lo wf_hypot.lo wf_j0.lo wf_j1.lo wf_jn.lo \
-@USE_LIBTOOL_TRUE@wf_lgamma.lo wrf_lgamma.lo wf_log.lo wf_log10.lo \
-@USE_LIBTOOL_TRUE@wf_pow.lo wf_remainder.lo wf_scalb.lo wf_sinh.lo \
-@USE_LIBTOOL_TRUE@wf_sqrt.lo wf_sincos.lo wf_cabs.lo wf_drem.lo \
-@USE_LIBTOOL_TRUE@sf_asinh.lo sf_atan.lo sf_ceil.lo sf_cos.lo sf_erf.lo \
-@USE_LIBTOOL_TRUE@sf_fabs.lo sf_floor.lo sf_frexp.lo sf_ldexp.lo \
-@USE_LIBTOOL_TRUE@sf_signif.lo sf_sin.lo sf_tan.lo sf_tanh.lo \
-@USE_LIBTOOL_TRUE@wf_exp2.lo wf_tgamma.lo
+@USE_LIBTOOL_TRUE@s_frexp.lo s_isnan.lo s_ldexp.lo s_signif.lo s_sin.lo \
+@USE_LIBTOOL_TRUE@s_tan.lo s_tanh.lo s_isinf.lo w_exp2.lo w_tgamma.lo \
+@USE_LIBTOOL_TRUE@kf_rem_pio2.lo kf_cos.lo kf_sin.lo kf_tan.lo \
+@USE_LIBTOOL_TRUE@ef_acos.lo ef_acosh.lo ef_asin.lo ef_atan2.lo \
+@USE_LIBTOOL_TRUE@ef_atanh.lo ef_cosh.lo ef_exp.lo ef_fmod.lo \
+@USE_LIBTOOL_TRUE@erf_gamma.lo ef_hypot.lo ef_j0.lo ef_j1.lo ef_jn.lo \
+@USE_LIBTOOL_TRUE@erf_lgamma.lo ef_log.lo ef_log10.lo ef_pow.lo \
+@USE_LIBTOOL_TRUE@ef_rem_pio2.lo ef_remainder.lo ef_scalb.lo ef_sinh.lo \
+@USE_LIBTOOL_TRUE@ef_sqrt.lo wf_acos.lo wf_acosh.lo wf_asin.lo \
+@USE_LIBTOOL_TRUE@wf_atan2.lo wf_atanh.lo wf_cosh.lo wf_exp.lo \
+@USE_LIBTOOL_TRUE@wf_fmod.lo wf_gamma.lo wrf_gamma.lo wf_hypot.lo \
+@USE_LIBTOOL_TRUE@wf_j0.lo wf_j1.lo wf_jn.lo wf_lgamma.lo wrf_lgamma.lo \
+@USE_LIBTOOL_TRUE@wf_log.lo wf_log10.lo wf_pow.lo wf_remainder.lo \
+@USE_LIBTOOL_TRUE@wf_scalb.lo wf_sinh.lo wf_sqrt.lo wf_sincos.lo \
+@USE_LIBTOOL_TRUE@wf_cabs.lo wf_drem.lo sf_asinh.lo sf_atan.lo \
+@USE_LIBTOOL_TRUE@sf_ceil.lo sf_cos.lo sf_erf.lo sf_fabs.lo sf_floor.lo \
+@USE_LIBTOOL_TRUE@sf_frexp.lo sf_isnan.lo sf_ldexp.lo sf_signif.lo \
+@USE_LIBTOOL_TRUE@sf_sin.lo sf_tan.lo sf_tanh.lo sf_isinf.lo wf_exp2.lo \
+@USE_LIBTOOL_TRUE@wf_tgamma.lo
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -546,6 +550,9 @@ stan.def: s_tan.c
stanh.def: s_tanh.c
$(CHEW) < $(srcdir)/s_tanh.c >$@ 2>/dev/null
touch stmp-def
+sisnan.def: s_isnan.c
+ $(CHEW) < $(srcdir)/s_isnan.c >$@ 2>/dev/null
+ touch stmp-def
# A partial dependency list.
diff --git a/newlib/libm/math/math.tex b/newlib/libm/math/math.tex
index 7bc56ce9a..0c84e618a 100644
--- a/newlib/libm/math/math.tex
+++ b/newlib/libm/math/math.tex
@@ -181,7 +181,7 @@ The library is set to X/Open mode by default.
@include common/sinfinity.def
@page
-@include common/sisnan.def
+@include math/sisnan.def
@page
@include math/sldexp.def
diff --git a/newlib/libm/math/s_isinf.c b/newlib/libm/math/s_isinf.c
new file mode 100644
index 000000000..87f099566
--- /dev/null
+++ b/newlib/libm/math/s_isinf.c
@@ -0,0 +1,26 @@
+/*
+ * isinf(x) returns 1 if x is infinity, else 0;
+ * no branching!
+ * Added by Cygnus Support.
+ */
+
+#include "fdlibm.h"
+
+#ifndef _DOUBLE_IS_32BITS
+
+#ifdef __STDC__
+ int isinf(double x)
+#else
+ int isinf(x)
+ double x;
+#endif
+{
+ __int32_t hx,lx;
+ EXTRACT_WORDS(hx,lx,x);
+ hx &= 0x7fffffff;
+ hx |= (__uint32_t)(lx|(-lx))>>31;
+ hx = 0x7ff00000 - hx;
+ return 1 - (int)((__uint32_t)(hx|(-hx))>>31);
+}
+
+#endif /* _DOUBLE_IS_32BITS */
diff --git a/newlib/libm/math/s_isnan.c b/newlib/libm/math/s_isnan.c
new file mode 100644
index 000000000..596bd2d2a
--- /dev/null
+++ b/newlib/libm/math/s_isnan.c
@@ -0,0 +1,122 @@
+
+/* @(#)s_isnan.c 5.1 93/09/24 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+FUNCTION
+ <<isnan>>, <<isnanf>>, <<isinf>>, <<isinff>>, <<finite>>, <<finitef>>---test for exceptional numbers
+
+INDEX
+ isnan
+INDEX
+ isinf
+INDEX
+ finite
+
+INDEX
+ isnanf
+INDEX
+ isinff
+INDEX
+ finitef
+
+ANSI_SYNOPSIS
+ #include <ieeefp.h>
+ int isnan(double <[arg]>);
+ int isinf(double <[arg]>);
+ int finite(double <[arg]>);
+ int isnanf(float <[arg]>);
+ int isinff(float <[arg]>);
+ int finitef(float <[arg]>);
+
+TRAD_SYNOPSIS
+ #include <ieeefp.h>
+ int isnan(<[arg]>)
+ double <[arg]>;
+ int isinf(<[arg]>)
+ double <[arg]>;
+ int finite(<[arg]>);
+ double <[arg]>;
+ int isnanf(<[arg]>);
+ float <[arg]>;
+ int isinff(<[arg]>);
+ float <[arg]>;
+ int finitef(<[arg]>);
+ float <[arg]>;
+
+
+DESCRIPTION
+ These functions provide information on the floating-point
+ argument supplied.
+
+ There are five major number formats:
+ o+
+ o zero
+ A number which contains all zero bits.
+ o subnormal
+ A number with a zero exponent but a nonzero fraction.
+ o normal
+ A number with an exponent and a fraction.
+ o infinity
+ A number with an all 1's exponent and a zero fraction.
+ o NAN
+ A number with an all 1's exponent and a nonzero fraction.
+
+ o-
+
+ <<isnan>> returns 1 if the argument is a nan. <<isinf>>
+ returns 1 if the argument is infinity. <<finite>> returns 1 if the
+ argument is zero, subnormal or normal.
+
+ The <<isnanf>>, <<isinff>> and <<finitef>> functions perform the same
+ operations as their <<isnan>>, <<isinf>> and <<finite>>
+ counterparts, but on single-precision floating-point numbers.
+
+QUICKREF
+ isnan - pure
+QUICKREF
+ isinf - pure
+QUICKREF
+ finite - pure
+QUICKREF
+ isnan - pure
+QUICKREF
+ isinf - pure
+QUICKREF
+ finite - pure
+*/
+
+/*
+ * isnan(x) returns 1 is x is nan, else 0;
+ * no branching!
+ */
+
+#include "fdlibm.h"
+
+#ifndef _DOUBLE_IS_32BITS
+
+#ifdef __STDC__
+ int isnan(double x)
+#else
+ int isnan(x)
+ double x;
+#endif
+{
+ __int32_t hx,lx;
+ EXTRACT_WORDS(hx,lx,x);
+ hx &= 0x7fffffff;
+ hx |= (__uint32_t)(lx|(-lx))>>31;
+ hx = 0x7ff00000 - hx;
+ return (int)(((__uint32_t)(hx))>>31);
+}
+
+#endif /* _DOUBLE_IS_32BITS */
diff --git a/newlib/libm/math/sf_isinf.c b/newlib/libm/math/sf_isinf.c
new file mode 100644
index 000000000..43a8abdf2
--- /dev/null
+++ b/newlib/libm/math/sf_isinf.c
@@ -0,0 +1,33 @@
+/*
+ * isinff(x) returns 1 if x is +-infinity, else 0;
+ * Added by Cygnus Support.
+ */
+
+#include "fdlibm.h"
+
+#ifdef __STDC__
+ int isinff(float x)
+#else
+ int isinff(x)
+ float x;
+#endif
+{
+ __int32_t ix;
+ GET_FLOAT_WORD(ix,x);
+ ix &= 0x7fffffff;
+ return FLT_UWORD_IS_INFINITE(ix);
+}
+
+#ifdef _DOUBLE_IS_32BITS
+
+#ifdef __STDC__
+ int isinf(double x)
+#else
+ int isinf(x)
+ double x;
+#endif
+{
+ return isinff((float) x);
+}
+
+#endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/newlib/libm/math/sf_isnan.c b/newlib/libm/math/sf_isnan.c
new file mode 100644
index 000000000..0b4be3e9c
--- /dev/null
+++ b/newlib/libm/math/sf_isnan.c
@@ -0,0 +1,47 @@
+/* sf_isnan.c -- float version of s_isnan.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * isnanf(x) returns 1 is x is nan, else 0;
+ */
+
+#include "fdlibm.h"
+
+#ifdef __STDC__
+ int isnanf(float x)
+#else
+ int isnanf(x)
+ float x;
+#endif
+{
+ __int32_t ix;
+ GET_FLOAT_WORD(ix,x);
+ ix &= 0x7fffffff;
+ return FLT_UWORD_IS_NAN(ix);
+}
+
+#ifdef _DOUBLE_IS_32BITS
+
+#ifdef __STDC__
+ int isnan(double x)
+#else
+ int isnan(x)
+ double x;
+#endif
+{
+ return isnanf((float) x);
+}
+
+#endif /* defined(_DOUBLE_IS_32BITS) */