diff options
author | das <das@FreeBSD.org> | 2010-12-07 02:19:15 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2010-12-07 02:19:15 +0000 |
commit | 35838fd0b5f2afbb914ec70c567255b68a6f1a89 (patch) | |
tree | 11f50c81ed2122342dd734ba06a5b41a33a096bb /lib/msun/src | |
parent | 83a1280f2b061e260e6471843e4c35fd3ce60c1a (diff) | |
download | FreeBSD-src-35838fd0b5f2afbb914ec70c567255b68a6f1a89.zip FreeBSD-src-35838fd0b5f2afbb914ec70c567255b68a6f1a89.tar.gz |
Fix various nits in style and comments that were pointed out by bde.
Code changes verified with md5.
Diffstat (limited to 'lib/msun/src')
-rw-r--r-- | lib/msun/src/e_log2.c | 8 | ||||
-rw-r--r-- | lib/msun/src/e_log2f.c | 8 | ||||
-rw-r--r-- | lib/msun/src/k_logf.h | 6 |
3 files changed, 13 insertions, 9 deletions
diff --git a/lib/msun/src/e_log2.c b/lib/msun/src/e_log2.c index 8a729d5..6cf3dbc 100644 --- a/lib/msun/src/e_log2.c +++ b/lib/msun/src/e_log2.c @@ -14,8 +14,8 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* log2(x) - * Return the base 2 logarithm of x. +/* + * Return the base 2 logarithm of x. See k_log.c for details on the algorithm. */ #include "math.h" @@ -24,8 +24,8 @@ __FBSDID("$FreeBSD$"); static const double two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -ivln2hi = 0x1.71547652000p+0, -ivln2lo = 0x1.705fc2eefa2p-33; +ivln2hi = 1.44269504072144627571e+00, /* 0x3ff71547, 0x65200000 */ +ivln2lo = 1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */ static const double zero = 0.0; diff --git a/lib/msun/src/e_log2f.c b/lib/msun/src/e_log2f.c index 6b2b966..7f1963b 100644 --- a/lib/msun/src/e_log2f.c +++ b/lib/msun/src/e_log2f.c @@ -12,14 +12,18 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +/* + * Return the base 2 logarithm of x. See k_log.c for details on the algorithm. + */ + #include "math.h" #include "math_private.h" #include "k_logf.h" static const float two25 = 3.3554432000e+07, /* 0x4c000000 */ -ivln2hi = 0x1.716p+0f, -ivln2lo = -0x1.7135a8fa03d11p-13; +ivln2hi = 1.4428710938e+00, /* 0x3fb8b000 */ +ivln2lo = -1.7605285393e-04; /* 0xb9389ad4 */ static const float zero = 0.0; diff --git a/lib/msun/src/k_logf.h b/lib/msun/src/k_logf.h index d11a563..d9f0f3d 100644 --- a/lib/msun/src/k_logf.h +++ b/lib/msun/src/k_logf.h @@ -12,8 +12,8 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __kernel_logf(x) - * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. +/* + * float version of __kernel_log(x). See k_log.c for details. */ static const float @@ -33,7 +33,7 @@ __kernel_logf(float x) f = x-(float)1.0; if((0x007fffff&(0x8000+ix))<0xc000) { /* -2**-9 <= f < 2**-9 */ - if(f==0.0) return 0.0; + if(f==0.0f) return 0.0f; return f*f*((float)0.33333333333333333*f-(float)0.5); } s = f/((float)2.0+f); |