+++ /dev/null
-/* @(#)s_frexp.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_frexp.c,v 1.12 2002/05/26 22:01:56 wiz Exp $");\r
-#endif\r
-\r
-/*\r
- * for non-zero x\r
- * x = frexp(arg,&exp);\r
- * return a double fp quantity x such that 0.5 <= |x| <1.0\r
- * and the corresponding binary exponent "exp". That is\r
- * arg = x*2^exp.\r
- * If arg is inf, 0.0, or NaN, then frexp(arg,&exp) returns arg\r
- * with *exp=0.\r
- */\r
-\r
-#include "math.h"\r
-#include "math_private.h"\r
-\r
-static const double\r
-two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */\r
-\r
-double\r
-frexp(double x, int *eptr)\r
-{\r
- int32_t hx, ix, lx;\r
- EXTRACT_WORDS(hx,lx,x);\r
- ix = 0x7fffffff&hx;\r
- *eptr = 0;\r
- if(ix>=0x7ff00000||((ix|lx)==0)) return x; /* 0,inf,nan */\r
- if (ix<0x00100000) { /* subnormal */\r
- x *= two54;\r
- GET_HIGH_WORD(hx,x);\r
- ix = hx&0x7fffffff;\r
- *eptr = -54;\r
- }\r
- *eptr += (ix>>20)-1022;\r
- hx = (hx&0x800fffff)|0x3fe00000;\r
- SET_HIGH_WORD(x,hx);\r
- return x;\r
-}\r