]>
Commit | Line | Data |
---|---|---|
2aa62f2b | 1 | /* @(#)w_log.c 5.1 93/09/24 */\r |
2 | /*\r | |
3 | * ====================================================\r | |
4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\r | |
5 | *\r | |
6 | * Developed at SunPro, a Sun Microsystems, Inc. business.\r | |
7 | * Permission to use, copy, modify, and distribute this\r | |
8 | * software is freely granted, provided that this notice\r | |
9 | * is preserved.\r | |
10 | * ====================================================\r | |
11 | */\r | |
12 | #include <LibConfig.h>\r | |
13 | #include <sys/EfiCdefs.h>\r | |
14 | #if defined(LIBM_SCCS) && !defined(lint)\r | |
15 | __RCSID("$NetBSD: w_log.c,v 1.9 2002/05/26 22:02:02 wiz Exp $");\r | |
16 | #endif\r | |
17 | \r | |
18 | /*\r | |
19 | * wrapper log(x)\r | |
20 | */\r | |
21 | \r | |
22 | #include "math.h"\r | |
23 | #include "math_private.h"\r | |
24 | \r | |
25 | \r | |
26 | double\r | |
27 | log(double x) /* wrapper log */\r | |
28 | {\r | |
29 | #ifdef _IEEE_LIBM\r | |
30 | return __ieee754_log(x);\r | |
31 | #else\r | |
32 | double z;\r | |
33 | z = __ieee754_log(x);\r | |
34 | if(_LIB_VERSION == _IEEE_ || isnan(x) || x > 0.0) return z;\r | |
35 | if(x==0.0)\r | |
36 | return __kernel_standard(x,x,16); /* log(0) */\r | |
37 | else\r | |
38 | return __kernel_standard(x,x,17); /* log(x<0) */\r | |
39 | #endif\r | |
40 | }\r |