Update.
[glibc.git] / sysdeps / generic / strtold.c
blobf1bb2f1c0d8ef7fee1ce7aa78f603cec14af18fe
1 #include <math.h>
3 #ifndef __NO_LONG_DOUBLE_MATH
4 /* The actual implementation for all floating point sizes is in strtod.c.
5 These macros tell it to produce the `long double' version, `strtold'. */
7 # define FLOAT long double
8 # define FLT LDBL
9 # ifdef USE_IN_EXTENDED_LOCALE_MODEL
10 # define STRTOF __strtold_l
11 # else
12 # define STRTOF strtold
13 # endif
14 # define MPN2FLOAT __mpn_construct_long_double
15 # define FLOAT_HUGE_VAL HUGE_VALL
16 # define SET_MANTISSA(flt, mant) \
17 do { union ieee854_long_double u; \
18 u.d = (flt); \
19 if ((mant & 0x7fffffffffffffffULL) == 0) \
20 mant = 0x4000000000000000ULL; \
21 u.ieee.mantissa0 = (((mant) >> 32) & 0x7fffffff) | 0x80000000; \
22 u.ieee.mantissa1 = (mant) & 0xffffffff; \
23 (flt) = u.d; \
24 } while (0)
26 # include "strtod.c"
27 #else
28 # include <stdlib.h>
29 /* There is no `long double' type, use the `double' implementations. */
30 long double
31 __strtold_internal (const char *nptr, char **endptr, int group)
33 return __strtod_internal (nptr, endptr, group);
36 long double
37 strtold (const char *nptr, char **endptr)
39 return __strtod_internal (nptr, endptr, 0);
41 #endif