]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add definition for `signbit' function. Future releases will have this
authorUlrich Drepper <drepper@redhat.com>
Thu, 20 Mar 1997 03:23:21 +0000 (03:23 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 20 Mar 1997 03:23:21 +0000 (03:23 +0000)
function.

sysdeps/libm-ieee754/w_pow.c
sysdeps/libm-ieee754/w_powf.c
sysdeps/libm-ieee754/w_powl.c

index 1711d71bda0d796b7d6e1cb685eaeb8c93f9d186..f1a9b98dfdfdf05d064ed15edbbb97dcc22fb851 100644 (file)
 #include "math_private.h"
 
 
+/* This is a quick hack for now.  In version 2.1.x we'll have a real
+   function.  */
+static inline int
+signbit (double x)
+{
+  int32_t hx;
+
+  GET_HIGH_WORD (hx, x);
+  return hx & 0x80000000;
+}
+
+
 #ifdef __STDC__
        double __pow(double x, double y)        /* wrapper pow */
 #else
index 0b20822be8fd57de27409672077c31c0a33c2669..17da39cd0304f492b1bbd1279613d2e9692328f3 100644 (file)
@@ -25,6 +25,18 @@ static char rcsid[] = "$NetBSD: w_powf.c,v 1.3 1995/05/10 20:49:41 jtc Exp $";
 #include "math_private.h"
 
 
+/* This is a quick hack for now.  In version 2.1.x we'll have a real
+   function.  */
+static inline int
+signbit (float x)
+{
+  int32_t hx;
+
+  GET_FLOAT_WORD (hx, x);
+  return hx & 0x80000000;
+}
+
+
 #ifdef __STDC__
        float __powf(float x, float y)  /* wrapper powf */
 #else
index aea572d905b430b65519c2846ebca7479f63d5eb..44924a99c152778766132ca11abf3b2e18181a10 100644 (file)
 #include "math_private.h"
 
 
+/* This is a quick hack for now.  In version 2.1.x we'll have a real
+   function.  */
+static inline int
+signbit (long double x)
+{
+  int32_t e;
+
+  GET_LDOUBLE_EXP (e, x);
+  return e & 0x8000;
+}
+
+
 #ifdef __STDC__
        long double __powl(long double x, long double y)/* wrapper powl */
 #else