From owner-svn-src-all@FreeBSD.ORG Sat Oct 15 05:00:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 206AC1065673; Sat, 15 Oct 2011 05:00:57 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 057FC8FC0A; Sat, 15 Oct 2011 05:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9F50u54095994; Sat, 15 Oct 2011 05:00:56 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9F50ubA095989; Sat, 15 Oct 2011 05:00:56 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201110150500.p9F50ubA095989@svn.freebsd.org> From: David Schultz Date: Sat, 15 Oct 2011 05:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226375 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2011 05:00:57 -0000 Author: das Date: Sat Oct 15 05:00:56 2011 New Revision: 226375 URL: http://svn.freebsd.org/changeset/base/226375 Log: Style fixes and updates to comments. Submitted by: bde Modified: head/lib/msun/src/e_log10.c head/lib/msun/src/e_log10f.c head/lib/msun/src/e_log2.c head/lib/msun/src/e_log2f.c Modified: head/lib/msun/src/e_log10.c ============================================================================== --- head/lib/msun/src/e_log10.c Sat Oct 15 04:24:54 2011 (r226374) +++ head/lib/msun/src/e_log10.c Sat Oct 15 05:00:56 2011 (r226375) @@ -15,7 +15,8 @@ __FBSDID("$FreeBSD$"); /* - * Return the base 10 logarithm of x. See k_log.c for details on the algorithm. + * Return the base 10 logarithm of x. See e_log.c and k_log.h for most + * comments. */ #include "math.h" @@ -40,14 +41,14 @@ __ieee754_log10(double x) EXTRACT_WORDS(hx,lx,x); - k=0; - if (hx < 0x00100000) { /* x < 2**-1022 */ - if (((hx&0x7fffffff)|lx)==0) - return -two54/zero; /* log(+-0)=-inf */ - if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ - k -= 54; x *= two54; /* subnormal number, scale up x */ + k=0; + if (hx < 0x00100000) { /* x < 2**-1022 */ + if (((hx&0x7fffffff)|lx)==0) + return -two54/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 54; x *= two54; /* subnormal number, scale up x */ GET_HIGH_WORD(hx,x); - } + } if (hx >= 0x7ff00000) return x+x; k += (hx>>20)-1023; hx &= 0x000fffff; Modified: head/lib/msun/src/e_log10f.c ============================================================================== --- head/lib/msun/src/e_log10f.c Sat Oct 15 04:24:54 2011 (r226374) +++ head/lib/msun/src/e_log10f.c Sat Oct 15 05:00:56 2011 (r226375) @@ -13,7 +13,7 @@ __FBSDID("$FreeBSD$"); /* - * Return the base 10 logarithm of x. See k_log.c for details on the algorithm. + * Float version of e_log10.c. See the latter for most comments. */ #include "math.h" @@ -37,14 +37,14 @@ __ieee754_log10f(float x) GET_FLOAT_WORD(hx,x); - k=0; - if (hx < 0x00800000) { /* x < 2**-126 */ - if ((hx&0x7fffffff)==0) - return -two25/zero; /* log(+-0)=-inf */ - if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ - k -= 25; x *= two25; /* subnormal number, scale up x */ + k=0; + if (hx < 0x00800000) { /* x < 2**-126 */ + if ((hx&0x7fffffff)==0) + return -two25/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 25; x *= two25; /* subnormal number, scale up x */ GET_FLOAT_WORD(hx,x); - } + } if (hx >= 0x7f800000) return x+x; k += (hx>>23)-127; hx &= 0x007fffff; Modified: head/lib/msun/src/e_log2.c ============================================================================== --- head/lib/msun/src/e_log2.c Sat Oct 15 04:24:54 2011 (r226374) +++ head/lib/msun/src/e_log2.c Sat Oct 15 05:00:56 2011 (r226375) @@ -15,7 +15,8 @@ __FBSDID("$FreeBSD$"); /* - * Return the base 2 logarithm of x. See k_log.c for details on the algorithm. + * Return the base 2 logarithm of x. See e_log.c and k_log.h for most + * comments. */ #include "math.h" @@ -38,14 +39,14 @@ __ieee754_log2(double x) EXTRACT_WORDS(hx,lx,x); - k=0; - if (hx < 0x00100000) { /* x < 2**-1022 */ - if (((hx&0x7fffffff)|lx)==0) - return -two54/zero; /* log(+-0)=-inf */ - if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ - k -= 54; x *= two54; /* subnormal number, scale up x */ + k=0; + if (hx < 0x00100000) { /* x < 2**-1022 */ + if (((hx&0x7fffffff)|lx)==0) + return -two54/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 54; x *= two54; /* subnormal number, scale up x */ GET_HIGH_WORD(hx,x); - } + } if (hx >= 0x7ff00000) return x+x; k += (hx>>20)-1023; hx &= 0x000fffff; Modified: head/lib/msun/src/e_log2f.c ============================================================================== --- head/lib/msun/src/e_log2f.c Sat Oct 15 04:24:54 2011 (r226374) +++ head/lib/msun/src/e_log2f.c Sat Oct 15 05:00:56 2011 (r226375) @@ -13,7 +13,7 @@ __FBSDID("$FreeBSD$"); /* - * Return the base 2 logarithm of x. See k_log.c for details on the algorithm. + * Float version of e_log2.c. See the latter for most comments. */ #include "math.h" @@ -35,14 +35,14 @@ __ieee754_log2f(float x) GET_FLOAT_WORD(hx,x); - k=0; - if (hx < 0x00800000) { /* x < 2**-126 */ - if ((hx&0x7fffffff)==0) - return -two25/zero; /* log(+-0)=-inf */ - if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ - k -= 25; x *= two25; /* subnormal number, scale up x */ + k=0; + if (hx < 0x00800000) { /* x < 2**-126 */ + if ((hx&0x7fffffff)==0) + return -two25/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 25; x *= two25; /* subnormal number, scale up x */ GET_FLOAT_WORD(hx,x); - } + } if (hx >= 0x7f800000) return x+x; k += (hx>>23)-127; hx &= 0x007fffff;