]>
Commit | Line | Data |
---|---|---|
0ecb606c | 1 | /* Copyright (C) 1999, 2004, 2005 Free Software Foundation, Inc. |
41bdb6e2 | 2 | This file is part of the GNU C Library. |
abfbdde1 UD |
3 | |
4 | The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
abfbdde1 UD |
8 | |
9 | The GNU C Library is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | Lesser General Public License for more details. |
abfbdde1 | 13 | |
41bdb6e2 AJ |
14 | You should have received a copy of the GNU Lesser General Public |
15 | License along with the GNU C Library; if not, write to the Free | |
16 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | 02111-1307 USA. */ | |
abfbdde1 UD |
18 | |
19 | #include <math.h> | |
20 | ||
21 | /* The actual implementation for all floating point sizes is in strtod.c. | |
22 | These macros tell it to produce the `long double' version, `strtold'. */ | |
23 | ||
ccadf7b5 UD |
24 | #define FLOAT long double |
25 | #define FLT LDBL | |
26 | #ifdef USE_WIDE_CHAR | |
27 | # define STRTOF wcstold_l | |
28 | # define __STRTOF __wcstold_l | |
29 | #else | |
30 | # define STRTOF strtold_l | |
31 | # define __STRTOF __strtold_l | |
32 | #endif | |
33 | #define MPN2FLOAT __mpn_construct_long_double | |
34 | #define FLOAT_HUGE_VAL HUGE_VALL | |
35 | #define SET_MANTISSA(flt, mant) \ | |
abfbdde1 UD |
36 | do { union ieee854_long_double u; \ |
37 | u.d = (flt); \ | |
38 | if ((mant & 0x7fffffffffffffffULL) == 0) \ | |
39 | mant = 0x4000000000000000ULL; \ | |
40 | u.ieee.mantissa0 = (((mant) >> 32) & 0x7fffffff) | 0x80000000; \ | |
41 | u.ieee.mantissa1 = (mant) & 0xffffffff; \ | |
42 | (flt) = u.d; \ | |
43 | } while (0) | |
44 | ||
0ecb606c | 45 | #include <stdlib/strtod_l.c> |