summaryrefslogtreecommitdiff
path: root/libm/double/fabs.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-11-22 14:04:29 +0000
committerEric Andersen <andersen@codepoet.org>2001-11-22 14:04:29 +0000
commit7ce331c01ce6eb7b3f5c715a38a24359da9c6ee2 (patch)
tree3a7e8476e868ae15f4da1b7ce26b2db6f434468c /libm/double/fabs.c
parentc117dd5fb183afb1a4790a6f6110d88704be6bf8 (diff)
Totally rework the math library, this time based on the MacOs X
math library (which is itself based on the math lib from FreeBSD). -Erik
Diffstat (limited to 'libm/double/fabs.c')
-rw-r--r--libm/double/fabs.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/libm/double/fabs.c b/libm/double/fabs.c
deleted file mode 100644
index 0c4531a6c..000000000
--- a/libm/double/fabs.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* fabs.c
- *
- * Absolute value
- *
- *
- *
- * SYNOPSIS:
- *
- * double x, y;
- *
- * y = fabs( x );
- *
- *
- *
- * DESCRIPTION:
- *
- * Returns the absolute value of the argument.
- *
- */
-
-
-#include <math.h>
-/* Avoid using UNK if possible. */
-#ifdef UNK
-#if BIGENDIAN
-#define MIEEE 1
-#else
-#define IBMPC 1
-#endif
-#endif
-
-double fabs(x)
-double x;
-{
-union
- {
- double d;
- short i[4];
- } u;
-
-u.d = x;
-#ifdef IBMPC
- u.i[3] &= 0x7fff;
-#endif
-#ifdef MIEEE
- u.i[0] &= 0x7fff;
-#endif
-#ifdef DEC
- u.i[3] &= 0x7fff;
-#endif
-#ifdef UNK
-if( u.d < 0 )
- u.d = -u.d;
-#endif
-return( u.d );
-}