171 #ifndef GDTOAIMP_H_INCLUDED 172 #define GDTOAIMP_H_INCLUDED 177 #ifdef GDTOA_HOST_DEBUG 181 fprintf(stderr, "%s\n", x); \ 185 #ifdef GDTOA_NO_ASSERT 189 #define Bug(x) assert(!(x)) 190 #endif // GDTOA_NO_ASSET 191 #endif // GDTOA_HOST_DEBUG 206 #define MALLOC malloc 210 #undef Avoid_Underflow 226 #define DBL_MAX_10_EXP 308 227 #define DBL_MAX_EXP 1024 229 #define DBL_MAX 1.7976931348623157e+308 234 #define DBL_MAX_10_EXP 75 235 #define DBL_MAX_EXP 63 237 #define DBL_MAX 7.2370055773322621e+75 242 #define DBL_MAX_10_EXP 38 243 #define DBL_MAX_EXP 127 245 #define DBL_MAX 1.7014118346046923e+38 250 #define LONG_MAX 2147483647 258 #define Scale_Bit 0x10 270 #ifndef GDTOA_NO_MATH_H 280 #if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1 293 #define word0(x) ((ULong*)&x)[1] 294 #define word1(x) ((ULong*)&x)[0] 296 #define word0(x) ((ULong*)&x)[0] 297 #define word1(x) ((ULong*)&x)[1] 301 #define word0(x) ((U*)&x)->L[1] 302 #define word1(x) ((U*)&x)->L[0] 304 #define word0(x) ((U*)&x)->L[0] 305 #define word1(x) ((U*)&x)->L[1] 307 #define dval(x) ((U*)&x)->d 314 #if defined(IEEE_8087) + defined(VAX) 315 #define Storeinc(a, b, c) \ 316 (((unsigned short*)a)[1] = (unsigned short)b, ((unsigned short*)a)[0] = (unsigned short)c, a++) 318 #define Storeinc(a, b, c) \ 319 (((unsigned short*)a)[0] = (unsigned short)b, ((unsigned short*)a)[1] = (unsigned short)c, a++) 330 #define Exp_shift1 20 331 #define Exp_msk1 0x100000 332 #define Exp_msk11 0x100000 333 #define Exp_mask 0x7ff00000 337 #define Exp_1 0x3ff00000 338 #define Exp_11 0x3ff00000 340 #define Frac_mask 0xfffff 341 #define Frac_mask1 0xfffff 344 #define Bndry_mask 0xfffff 345 #define Bndry_mask1 0xfffff 347 #define Sign_bit 0x80000000 356 #define Flt_Rounds FLT_ROUNDS 363 #undef Sudden_Underflow 364 #define Sudden_Underflow 369 #define Exp_shift1 24 370 #define Exp_msk1 0x1000000 371 #define Exp_msk11 0x1000000 372 #define Exp_mask 0x7f000000 375 #define Exp_1 0x41000000 376 #define Exp_11 0x41000000 378 #define Frac_mask 0xffffff 379 #define Frac_mask1 0xffffff 382 #define Bndry_mask 0xefffff 383 #define Bndry_mask1 0xffffff 385 #define Sign_bit 0x80000000 387 #define Tiny0 0x100000 396 #define Exp_msk1 0x80 397 #define Exp_msk11 0x800000 398 #define Exp_mask 0x7f80 401 #define Exp_1 0x40800000 402 #define Exp_11 0x4080 404 #define Frac_mask 0x7fffff 405 #define Frac_mask1 0xffff007f 408 #define Bndry_mask 0xffff007f 409 #define Bndry_mask1 0xffff007f 411 #define Sign_bit 0x8000 425 #define rounded_product(a, b) a = rnd_prod(a, b) 426 #define rounded_quotient(a, b) a = rnd_quot(a, b) 428 extern double rnd_prod(), rnd_quot();
430 extern double rnd_prod(
double,
double), rnd_quot(
double,
double);
433 #define rounded_product(a, b) a *= b 434 #define rounded_quotient(a, b) a /= b 437 #define Big0 (Frac_mask1 | Exp_msk1 * (DBL_MAX_EXP + Bias - 1)) 438 #define Big1 0xffffffff 458 #define Llong long long 461 #define ULLong unsigned Llong 469 #define ALL_ON 0xffffffff 474 #define ALL_ON 0xffff 477 #ifndef MULTIPLE_THREADS 478 #define ACQUIRE_DTOA_LOCK(n) 479 #define FREE_DTOA_LOCK(n) 494 #ifdef DECLARE_SIZE_T 495 typedef unsigned int size_t;
497 extern void memcpy_D2A
ANSI((
void*,
const void*,
size_t));
498 #define Bcopy(x, y) \ 499 memcpy_D2A(&x->sign, &y->sign, (size_t)(y->wds) * sizeof(ULong) + 2 * sizeof(int)) 501 #define Bcopy(x, y) memcpy(&x->sign, &y->sign, (size_t)(y->wds) * sizeof(ULong) + 2 * sizeof(int)) 504 #define Balloc Balloc_D2A 505 #define Bfree Bfree_D2A 506 #define ULtoQ ULtoQ_D2A 507 #define ULtof ULtof_D2A 508 #define ULtod ULtod_D2A 509 #define ULtodd ULtodd_D2A 510 #define ULtox ULtox_D2A 511 #define ULtoxL ULtoxL_D2A 512 #define any_on any_on_D2A 514 #define bigtens bigtens_D2A 516 #define copybits copybits_D2A 518 #define decrement decrement_D2A 519 #define diff diff_D2A 520 #define dtoa_result dtoa_result_D2A 521 #define g__fmt g__fmt_D2A 522 #define gethex gethex_D2A 523 #define hexdig hexdig_D2A 524 #define hexnan hexnan_D2A 525 #define hi0bits(x) hi0bits_D2A((ULong)(x)) 527 #define increment increment_D2A 528 #define lo0bits lo0bits_D2A 529 #define lshift lshift_D2A 530 #define match match_D2A 531 #define mult mult_D2A 532 #define multadd multadd_D2A 533 #define nrv_alloc nrv_alloc_D2A 534 #define pow5mult pow5mult_D2A 535 #define quorem quorem_D2A 536 #define ratio ratio_D2A 537 #define rshift rshift_D2A 538 #define rv_alloc rv_alloc_D2A 540 #define set_ones set_ones_D2A 541 #define strcp strcp_D2A 542 #define strtoIg strtoIg_D2A 544 #define tens tens_D2A 545 #define tinytens tinytens_D2A 546 #define tinytens tinytens_D2A 547 #define trailz trailz_D2A 552 extern unsigned char hexdig[];
569 extern char*
dtoa ANSI((
double d,
int mode,
int ndigits,
int* decpt,
int*
sign,
char** rve));
590 extern char*
strcp ANSI((
char*,
const char*));
592 extern double strtod ANSI((
const char* s00,
char** se));
595 extern double ulp ANSI((
double));
614 #define NAN_WORD0 d_QNAN0 617 #define NAN_WORD1 d_QNAN1 623 #define NAN_WORD0 d_QNAN1 626 #define NAN_WORD1 d_QNAN0 634 #ifdef Sudden_Underflow
Bigint *Balloc ANSI((int))
char * dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
Exactly one of IEEE_MC68k
void hexdig_init_D2A(Void)
int hi0bits_D2A(register ULong x)
double strtod(const char *__restrict str, char **__restrict str_end)
Interprets a floating-point value in a byte string pointed to by str.