Handle invalid buffer pointers when count is zero.
[glibc/history.git] / math / w_exp10.c
blob9447d8fa2a6354b648d4f3d7177c18737edafaf6
1 /* @(#)w_exp10.c
2 * Conversion to exp10 by Ulrich Drepper <drepper@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 * ====================================================
17 * wrapper exp10(x)
20 #include <math.h>
21 #include "math_private.h"
23 #ifdef __STDC__
24 double __exp10(double x) /* wrapper exp10 */
25 #else
26 double __exp10(x) /* wrapper exp10 */
27 double x;
28 #endif
30 #ifdef _IEEE_LIBM
31 return __ieee754_exp10(x);
32 #else
33 double z;
34 z = __ieee754_exp10(x);
35 if(_LIB_VERSION == _IEEE_) return z;
36 if(!__finite(z) && __finite(x)) {
37 /* exp10 overflow (46) if x > 0, underflow (47) if x < 0. */
38 return __kernel_standard(x,x,46+!!__signbit(x));
40 return z;
41 #endif
43 weak_alias (__exp10, exp10)
44 strong_alias (__exp10, __pow10)
45 weak_alias (__pow10, pow10)
46 #ifdef NO_LONG_DOUBLE
47 strong_alias (__exp10, __exp10l)
48 weak_alias (__exp10, exp10l)
49 strong_alias (__exp10l, __pow10l)
50 weak_alias (__pow10l, pow10l)
51 #endif