123a6b3b589484c84c02ef9efb562fbeb76ca081
[platform/upstream/linaro-glibc.git] / sysdeps / generic / s_ldexpl.c
1 /* s_ldexpl.c -- long double version of s_ldexp.c.
2  * Conversion to long double by Ulrich Drepper,
3  * Cygnus Support, drepper@cygnus.com.
4  */
5
6 /*
7  * ====================================================
8  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9  *
10  * Developed at SunPro, a Sun Microsystems, Inc. business.
11  * Permission to use, copy, modify, and distribute this
12  * software is freely granted, provided that this notice
13  * is preserved.
14  * ====================================================
15  */
16
17 #if defined(LIBM_SCCS) && !defined(lint)
18 static char rcsid[] = "$NetBSD: $";
19 #endif
20
21 #include "math.h"
22 #include "math_private.h"
23 #include <errno.h>
24
25 #ifdef __STDC__
26         long double __ldexpl(long double value, int exp)
27 #else
28         long double __ldexpl(value, exp)
29         long double value; int exp;
30 #endif
31 {
32         if(!__finitel(value)||value==0.0) return value;
33         value = __scalbnl(value,exp);
34         if(!__finitel(value)||value==0.0) __set_errno (ERANGE);
35         return value;
36 }
37 weak_alias (__ldexpl, ldexpl)