Cygwin: SetThreadName: avoid spurious debug message
[newlib-cygwin.git] / newlib / libm / math / wf_log10.c
blob529ed651447fda59b392415bc3940d89a994a9fd
1 /* wf_log10.c -- float version of w_log10.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3 */
5 /*
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9 * Developed at SunPro, a Sun Microsystems, Inc. business.
10 * Permission to use, copy, modify, and distribute this
11 * software is freely granted, provided that this notice
12 * is preserved.
13 * ====================================================
16 /*
17 * wrapper log10f(X)
20 #include "fdlibm.h"
21 #include <errno.h>
23 #ifdef __STDC__
24 float log10f(float x) /* wrapper log10f */
25 #else
26 float log10f(x) /* wrapper log10f */
27 float x;
28 #endif
30 #ifdef _IEEE_LIBM
31 return __ieee754_log10f(x);
32 #else
33 float z;
34 z = __ieee754_log10f(x);
35 if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
36 if(x<=0.0f) {
37 if(x==0.0f) {
38 /* log10f(0) */
39 errno = ERANGE;
40 return -HUGE_VALF;
41 } else {
42 /* log10f(x<0) */
43 errno = EDOM;
44 return nanf("");
46 } else
47 return z;
48 #endif
51 #ifdef _DOUBLE_IS_32BITS
53 #ifdef __STDC__
54 double log10(double x)
55 #else
56 double log10(x)
57 double x;
58 #endif
60 return (double) log10f((float) x);
63 #endif /* defined(_DOUBLE_IS_32BITS) */