e_log2.c (251024) | e_log2.c (251292) |
---|---|
1 2/* @(#)e_log10.c 1.3 95/01/18 */ 3/* 4 * ==================================================== 5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 6 * 7 * Developed at SunSoft, a Sun Microsystems, Inc. business. 8 * Permission to use, copy, modify, and distribute this 9 * software is freely granted, provided that this notice 10 * is preserved. 11 * ==================================================== 12 */ 13 14#include <sys/cdefs.h> | 1 2/* @(#)e_log10.c 1.3 95/01/18 */ 3/* 4 * ==================================================== 5 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 6 * 7 * Developed at SunSoft, a Sun Microsystems, Inc. business. 8 * Permission to use, copy, modify, and distribute this 9 * software is freely granted, provided that this notice 10 * is preserved. 11 * ==================================================== 12 */ 13 14#include <sys/cdefs.h> |
15__FBSDID("$FreeBSD: head/lib/msun/src/e_log2.c 251024 2013-05-27 08:50:10Z das $"); | 15__FBSDID("$FreeBSD: head/lib/msun/src/e_log2.c 251292 2013-06-03 09:14:31Z das $"); |
16 17/* 18 * Return the base 2 logarithm of x. See e_log.c and k_log.h for most 19 * comments. 20 * 21 * This reduces x to {k, 1+f} exactly as in e_log.c, then calls the kernel, 22 * then does the combining and scaling steps 23 * log2(x) = (f - 0.5*f*f + k_log1p(f)) / ln2 + k --- 80 unchanged lines hidden (view full) --- 104 105 /* spadd(val_hi, val_lo, y), except for not using double_t: */ 106 w = y + val_hi; 107 val_lo += (y - w) + val_hi; 108 val_hi = w; 109 110 return val_lo + val_hi; 111} | 16 17/* 18 * Return the base 2 logarithm of x. See e_log.c and k_log.h for most 19 * comments. 20 * 21 * This reduces x to {k, 1+f} exactly as in e_log.c, then calls the kernel, 22 * then does the combining and scaling steps 23 * log2(x) = (f - 0.5*f*f + k_log1p(f)) / ln2 + k --- 80 unchanged lines hidden (view full) --- 104 105 /* spadd(val_hi, val_lo, y), except for not using double_t: */ 106 w = y + val_hi; 107 val_lo += (y - w) + val_hi; 108 val_hi = w; 109 110 return val_lo + val_hi; 111} |
112 113#if (LDBL_MANT_DIG == 53) 114__weak_reference(log2, log2l); 115#endif |
|