1b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project
2b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project/* @(#)w_log.c 1.3 95/01/18 */
3b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project/*
4b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project * ====================================================
5b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project *
7b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project * Developed at SunSoft, a Sun Microsystems, Inc. business.
8b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project * Permission to use, copy, modify, and distribute this
9b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project * software is freely granted, provided that this notice
10b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project * is preserved.
11b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project * ====================================================
12b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project */
13b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project
14b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project/*
15b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project * wrapper ieee_log(x)
16b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project */
17b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project
18b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project#include "fdlibm.h"
19b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project
20b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project
21b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project#ifdef __STDC__
22b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project	double ieee_log(double x)		/* wrapper log */
23b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project#else
24b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project	double ieee_log(x)			/* wrapper log */
25b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project	double x;
26b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project#endif
27b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project{
28b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project#ifdef _IEEE_LIBM
29b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project	return __ieee754_log(x);
30b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project#else
31b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project	double z;
32b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project	z = __ieee754_log(x);
33b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project	if(_LIB_VERSION == _IEEE_ || ieee_isnan(x) || x > 0.0) return z;
34b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project	if(x==0.0)
35b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project	    return __kernel_standard(x,x,16); /* ieee_log(0) */
36b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project	else
37b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project	    return __kernel_standard(x,x,17); /* ieee_log(x<0) */
38b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project#endif
39b07e1d9fd8d9e4e03698e0bd9bf77154c5390326The Android Open Source Project}
40