]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/Math/s_modf.c
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / StdLib / LibC / Math / s_modf.c
diff --git a/StdLib/LibC/Math/s_modf.c b/StdLib/LibC/Math/s_modf.c
deleted file mode 100644 (file)
index bf4faf4..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* @(#)s_modf.c 5.1 93/09/24 */\r
-/*\r
- * ====================================================\r
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\r
- *\r
- * Developed at SunPro, a Sun Microsystems, Inc. business.\r
- * Permission to use, copy, modify, and distribute this\r
- * software is freely granted, provided that this notice\r
- * is preserved.\r
- * ====================================================\r
- */\r
-#include  <LibConfig.h>\r
-#include  <sys/EfiCdefs.h>\r
-#if defined(LIBM_SCCS) && !defined(lint)\r
-__RCSID("$NetBSD: s_modf.c,v 1.11 2002/05/26 22:01:57 wiz Exp $");\r
-#endif\r
-\r
-/*\r
- * modf(double x, double *iptr)\r
- * return fraction part of x, and return x's integral part in *iptr.\r
- * Method:\r
- *  Bit twiddling.\r
- *\r
- * Exception:\r
- *  No exception.\r
- */\r
-\r
-#include "math.h"\r
-#include "math_private.h"\r
-\r
-static const double one = 1.0;\r
-\r
-double\r
-modf(double x, double *iptr)\r
-{\r
-  int32_t i0,i1,j0;\r
-  u_int32_t i;\r
-  EXTRACT_WORDS(i0,i1,x);\r
-  j0 = ((i0>>20)&0x7ff)-0x3ff;  /* exponent of x */\r
-  if(j0<20) {     /* integer part in high x */\r
-      if(j0<0) {      /* |x|<1 */\r
-          INSERT_WORDS(*iptr,i0&0x80000000,0);  /* *iptr = +-0 */\r
-    return x;\r
-      } else {\r
-    i = (0x000fffff)>>j0;\r
-    if(((i0&i)|i1)==0) {    /* x is integral */\r
-        u_int32_t high;\r
-        *iptr = x;\r
-        GET_HIGH_WORD(high,x);\r
-        INSERT_WORDS(x,high&0x80000000,0);  /* return +-0 */\r
-        return x;\r
-    } else {\r
-        INSERT_WORDS(*iptr,i0&(~i),0);\r
-        return x - *iptr;\r
-    }\r
-      }\r
-  } else if (j0>51) {   /* no fraction part */\r
-      u_int32_t high;\r
-      *iptr = x*one;\r
-      GET_HIGH_WORD(high,x);\r
-      INSERT_WORDS(x,high&0x80000000,0);  /* return +-0 */\r
-      return x;\r
-  } else {      /* fraction part in low x */\r
-      i = ((u_int32_t)(0xffffffff))>>(j0-20);\r
-      if((i1&i)==0) {     /* x is integral */\r
-          u_int32_t high;\r
-    *iptr = x;\r
-    GET_HIGH_WORD(high,x);\r
-    INSERT_WORDS(x,high&0x80000000,0);  /* return +-0 */\r
-    return x;\r
-      } else {\r
-          INSERT_WORDS(*iptr,i0,i1&(~i));\r
-    return x - *iptr;\r
-      }\r
-  }\r
-}\r