classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] finite() for fdlibm


From: Christian Thalinger
Subject: [cp-patches] finite() for fdlibm
Date: Wed, 29 Jun 2005 17:44:40 +0200
User-agent: Mutt/1.5.9i

Hi!

Since there are some finite() calls in classpath's native code, we
should also provide a implementation. This one is taken and adapted from
the current file available from http://www.netlib.org/fdlibm/.

TWISTI

2005-07-29  Christian Thalinger  <address@hidden>

        * native/fdlibm/Makefile.am: Added s_finite.c
        * native/fdlibm/s_finite.c: Added

Index: native/fdlibm/Makefile.am
===================================================================
RCS file:
/ahome/cacao/cacaocvs/cacao/src/classpath/native/fdlibm/Makefile.am,v
retrieving revision 1.5
diff -u -3 -p -r1.5 Makefile.am
--- native/fdlibm/Makefile.am   15 Nov 2004 20:00:11 -0000      1.5
+++ native/fdlibm/Makefile.am   29 Jun 2005 15:38:59 -0000
@@ -28,6 +28,7 @@ libfdlibm_la_SOURCES =  \
                        s_cos.c \
                        s_fabs.c \
                        sf_fabs.c \
+                       s_finite.c \
                        s_floor.c \
                        sf_rint.c \
                        s_rint.c \
Index: native/fdlibm/s_finite.c
===================================================================
RCS file: native/fdlibm/s_finite.c
diff -N native/fdlibm/s_finite.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ native/fdlibm/s_finite.c    29 Jun 2005 15:38:59 -0000
@@ -0,0 +1,31 @@
+
+/* @(#)s_finite.c 1.3 95/01/18 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice 
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * finite(x) returns 1 is x is finite, else 0;
+ * no branching!
+ */
+
+#include "fdlibm.h"
+
+#ifdef __STDC__
+       int finite(double x)
+#else
+       int finite(x)
+       double x;
+#endif
+{
+       uint32_t high; 
+       GET_HIGH_WORD(high,x);
+       return  (unsigned)((high&0x7fffffff)-0x7ff00000)>>31;
+}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]