Cygwin: (mostly) drop NT4 and Samba < 3.0 support
[newlib-cygwin.git] / winsup / cygwin / math / ldexpl.c
blob2438617c3c01a51b809f9972cda58386ed13f09b
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6 #include <math.h>
7 #include <errno.h>
9 long double ldexpl(long double x, int expn)
11 long double res = 0.0L;
12 if (!isfinite (x) || x == 0.0L)
13 return x;
15 __asm__ __volatile__ ("fscale"
16 : "=t" (res)
17 : "0" (x), "u" ((long double) expn));
19 if (!isfinite (res) || res == 0.0L)
20 errno = ERANGE;
22 return res;