stdio.h defines BUFSIZ
[unix-history] / usr / src / usr.bin / f77 / libF77 / d_sign.c
index 5e93804..9c7df2a 100644 (file)
@@ -3,9 +3,10 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)d_sign.c    5.1     %G%
+ *     @(#)d_sign.c    5.3     %G%
  */
 
  */
 
+#ifndef tahoe
 double d_sign(a,b)
 double *a, *b;
 {
 double d_sign(a,b)
 double *a, *b;
 {
@@ -13,3 +14,18 @@ double x;
 x = (*a >= 0 ? *a : - *a);
 return( *b >= 0 ? x : -x);
 }
 x = (*a >= 0 ? *a : - *a);
 return( *b >= 0 ? x : -x);
 }
+
+#else
+
+#include <tahoe/math/FP.h>
+
+double d_sign(a,b)
+double *a, *b;
+{
+double x;
+x = *a;
+if ((*a < 0) || (*b < 0))
+       *(unsigned long *)&x ^= SIGN_BIT;
+return(x);
+}
+#endif