Back to index

glibc  2.9
w_expl.c
Go to the documentation of this file.
00001 /* w_expl.c -- long double version of w_exp.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 expl(x)
00023  */
00024 
00025 #include "math.h"
00026 #include "math_private.h"
00027 
00028 #ifdef __STDC__
00029 static const long double
00030 #else
00031 static long double
00032 #endif
00033 o_threshold= 1.1356523406294143949491931077970763428449E4L,
00034 u_threshold= -1.1433462743336297878837243843452621503410E4;
00035 
00036 #ifdef __STDC__
00037        long double __expl(long double x)  /* wrapper exp */
00038 #else
00039        long double __expl(x)                     /* wrapper exp */
00040        long double x;
00041 #endif
00042 {
00043 #ifdef _IEEE_LIBM
00044        return __ieee754_expl(x);
00045 #else
00046        long double z;
00047        z = __ieee754_expl(x);
00048        if(_LIB_VERSION == _IEEE_) return z;
00049        if(__finitel(x)) {
00050            if(x>o_threshold)
00051                return __kernel_standard(x,x,206); /* exp overflow */
00052            else if(x<u_threshold)
00053                return __kernel_standard(x,x,207); /* exp underflow */
00054        }
00055        return z;
00056 #endif
00057 }
00058 weak_alias (__expl, expl)