Back to index

glibc  2.9
w_log10l.c
Go to the documentation of this file.
00001 /* w_log10l.c -- long double version of w_log10.c.
00002  * Conversion to long double by Ulrich Drepper,
00003  * Cygnus Support, drepper@cygnus.com.
00004  */
00005 
00006 /*
00007  * ====================================================
00008  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
00009  *
00010  * Developed at SunPro, a Sun Microsystems, Inc. business.
00011  * Permission to use, copy, modify, and distribute this
00012  * software is freely granted, provided that this notice
00013  * is preserved.
00014  * ====================================================
00015  */
00016 
00017 #if defined(LIBM_SCCS) && !defined(lint)
00018 static char rcsid[] = "$NetBSD: $";
00019 #endif
00020 
00021 /*
00022  * wrapper log10l(X)
00023  */
00024 
00025 #include <math.h>
00026 #include "math_private.h"
00027 
00028 
00029 #ifdef __STDC__
00030        long double __log10l(long double x)       /* wrapper log10l */
00031 #else
00032        long double __log10l(x)                   /* wrapper log10l */
00033        long double x;
00034 #endif
00035 {
00036 #ifdef _IEEE_LIBM
00037        return __ieee754_log10l(x);
00038 #else
00039        long double z;
00040        z = __ieee754_log10l(x);
00041        if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
00042        if(x<=0.0) {
00043            if(x==0.0)
00044                return __kernel_standard(x,x,218); /* log10(0) */
00045            else
00046                return __kernel_standard(x,x,219); /* log10(x<0) */
00047        } else
00048            return z;
00049 #endif
00050 }
00051 weak_alias (__log10l, log10l)