OLD | NEW |
1 /**************************************************************** | 1 /**************************************************************** |
2 * | 2 * |
3 * The author of this software is David M. Gay. | 3 * The author of this software is David M. Gay. |
4 * | 4 * |
5 * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. | 5 * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. |
6 * | 6 * |
7 * Permission to use, copy, modify, and distribute this software for any | 7 * Permission to use, copy, modify, and distribute this software for any |
8 * purpose without fee is hereby granted, provided that this entire notice | 8 * purpose without fee is hereby granted, provided that this entire notice |
9 * is included in all copies of any software which is or includes a copy | 9 * is included in all copies of any software which is or includes a copy |
10 * or modification of this software and in all copies of the supporting | 10 * or modification of this software and in all copies of the supporting |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 * to strtod. This testing proceeds by initially truncating the | 176 * to strtod. This testing proceeds by initially truncating the |
177 * input string, then if necessary comparing the whole string with | 177 * input string, then if necessary comparing the whole string with |
178 * a decimal expansion to decide close cases. This logic is only | 178 * a decimal expansion to decide close cases. This logic is only |
179 * used for input more than STRTOD_DIGLIM digits long (default 40). | 179 * used for input more than STRTOD_DIGLIM digits long (default 40). |
180 */ | 180 */ |
181 | 181 |
182 #define IEEE_8087 | 182 #define IEEE_8087 |
183 #define NO_HEX_FP | 183 #define NO_HEX_FP |
184 | 184 |
185 #ifndef Long | 185 #ifndef Long |
| 186 #if __LP64__ |
| 187 #define Long int |
| 188 #else |
186 #define Long long | 189 #define Long long |
187 #endif | 190 #endif |
| 191 #endif |
188 #ifndef ULong | 192 #ifndef ULong |
189 typedef unsigned Long ULong; | 193 typedef unsigned Long ULong; |
190 #endif | 194 #endif |
191 | 195 |
192 #ifdef DEBUG | 196 #ifdef DEBUG |
193 #include "stdio.h" | 197 #include "stdio.h" |
194 #define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);} | 198 #define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);} |
195 #endif | 199 #endif |
196 | 200 |
197 #include "stdlib.h" | 201 #include "stdlib.h" |
(...skipping 16 matching lines...) Expand all Loading... |
214 extern void *MALLOC(size_t); | 218 extern void *MALLOC(size_t); |
215 #endif | 219 #endif |
216 #else | 220 #else |
217 #define MALLOC malloc | 221 #define MALLOC malloc |
218 #endif | 222 #endif |
219 | 223 |
220 #ifndef Omit_Private_Memory | 224 #ifndef Omit_Private_Memory |
221 #ifndef PRIVATE_MEM | 225 #ifndef PRIVATE_MEM |
222 #define PRIVATE_MEM 2304 | 226 #define PRIVATE_MEM 2304 |
223 #endif | 227 #endif |
224 #define PRIVATE_mem ((PRIVATE_MEM+sizeof(double)-1)/sizeof(double)) | 228 #define PRIVATE_mem ((unsigned)((PRIVATE_MEM+sizeof(double)-1)/sizeof(double))) |
225 static double private_mem[PRIVATE_mem], *pmem_next = private_mem; | 229 static double private_mem[PRIVATE_mem], *pmem_next = private_mem; |
226 #endif | 230 #endif |
227 | 231 |
228 #undef IEEE_Arith | 232 #undef IEEE_Arith |
229 #undef Avoid_Underflow | 233 #undef Avoid_Underflow |
230 #ifdef IEEE_MC68k | 234 #ifdef IEEE_MC68k |
231 #define IEEE_Arith | 235 #define IEEE_Arith |
232 #endif | 236 #endif |
233 #ifdef IEEE_8087 | 237 #ifdef IEEE_8087 |
234 #define IEEE_Arith | 238 #define IEEE_Arith |
(...skipping 3961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4196 #endif | 4200 #endif |
4197 Bfree(b); | 4201 Bfree(b); |
4198 *s = 0; | 4202 *s = 0; |
4199 *decpt = k + 1; | 4203 *decpt = k + 1; |
4200 if (rve) | 4204 if (rve) |
4201 *rve = s; | 4205 *rve = s; |
4202 return s0; | 4206 return s0; |
4203 } | 4207 } |
4204 | 4208 |
4205 } // namespace dmg_fp | 4209 } // namespace dmg_fp |
OLD | NEW |