strtorx.c (50dad48bb740a8e56d185d9e8c165e0758f46e25) strtorx.c (3c87aa1d3dc1d8dad3efad322852a8e1e76dee55)
1/****************************************************************
2
3The author of this software is David M. Gay.
4
5Copyright (C) 1998, 2000 by Lucent Technologies
6All Rights Reserved
7
8Permission to use, copy, modify, and distribute this software and

--- 92 unchanged lines hidden (view full) ---

101 L[4] = ldus_QNAN4;
102 }
103 if (k & STRTOG_Neg)
104 L[_0] |= 0x8000;
105 }
106
107 int
108#ifdef KR_headers
1/****************************************************************
2
3The author of this software is David M. Gay.
4
5Copyright (C) 1998, 2000 by Lucent Technologies
6All Rights Reserved
7
8Permission to use, copy, modify, and distribute this software and

--- 92 unchanged lines hidden (view full) ---

101 L[4] = ldus_QNAN4;
102 }
103 if (k & STRTOG_Neg)
104 L[_0] |= 0x8000;
105 }
106
107 int
108#ifdef KR_headers
109strtorx(s, sp, rounding, L) CONST char *s; char **sp; int rounding; void *L;
109strtorx_l(s, sp, rounding, L, locale) CONST char *s; char **sp; int rounding;
110void *L; locale_t locale;
110#else
111#else
111strtorx(CONST char *s, char **sp, int rounding, void *L)
112strtorx_l(CONST char *s, char **sp, int rounding, void *L, locale_t locale)
112#endif
113{
114 static FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI };
115 FPI *fpi, fpi1;
116 ULong bits[2];
117 Long exp;
118 int k;
119
120 fpi = &fpi0;
121 if (rounding != FPI_Round_near) {
122 fpi1 = fpi0;
123 fpi1.rounding = rounding;
124 fpi = &fpi1;
125 }
113#endif
114{
115 static FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI };
116 FPI *fpi, fpi1;
117 ULong bits[2];
118 Long exp;
119 int k;
120
121 fpi = &fpi0;
122 if (rounding != FPI_Round_near) {
123 fpi1 = fpi0;
124 fpi1.rounding = rounding;
125 fpi = &fpi1;
126 }
126 k = strtodg(s, sp, fpi, &exp, bits);
127 k = strtodg_l(s, sp, fpi, &exp, bits, locale);
127 ULtox((UShort*)L, bits, exp, k);
128 return k;
129 }
128 ULtox((UShort*)L, bits, exp, k);
129 return k;
130 }