Lines 207-217
typedef unsigned Long ULong;
Link Here
|
207 |
#endif |
207 |
#endif |
208 |
|
208 |
|
209 |
#ifdef MALLOC |
209 |
#ifdef MALLOC |
210 |
#ifdef KR_headers |
|
|
211 |
extern char *MALLOC(); |
212 |
#else |
213 |
extern void *MALLOC(size_t); |
210 |
extern void *MALLOC(size_t); |
214 |
#endif |
|
|
215 |
#else |
211 |
#else |
216 |
#define MALLOC malloc |
212 |
#define MALLOC malloc |
217 |
#endif |
213 |
#endif |
Lines 273-284
extern "C" {
Link Here
|
273 |
#endif |
269 |
#endif |
274 |
|
270 |
|
275 |
#ifndef CONST |
271 |
#ifndef CONST |
276 |
#ifdef KR_headers |
|
|
277 |
#define CONST /* blank */ |
278 |
#else |
279 |
#define CONST const |
272 |
#define CONST const |
280 |
#endif |
273 |
#endif |
281 |
#endif |
|
|
282 |
|
274 |
|
283 |
#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1 |
275 |
#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1 |
284 |
Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined. |
276 |
Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined. |
Lines 286-322
Exactly one of IEEE_8087, IEEE_MC68k, VA
Link Here
|
286 |
|
278 |
|
287 |
typedef union { double d; ULong L[2]; } U; |
279 |
typedef union { double d; ULong L[2]; } U; |
288 |
|
280 |
|
289 |
#ifdef YES_ALIAS |
281 |
#define dval(x) (x).d |
290 |
#define dval(x) x |
|
|
291 |
#ifdef IEEE_8087 |
282 |
#ifdef IEEE_8087 |
292 |
#define word0(x) ((ULong *)&x)[1] |
283 |
#define word0(x) (x).L[1] |
293 |
#define word1(x) ((ULong *)&x)[0] |
284 |
#define word1(x) (x).L[0] |
294 |
#else |
285 |
#else |
295 |
#define word0(x) ((ULong *)&x)[0] |
286 |
#define word0(x) (x).L[0] |
296 |
#define word1(x) ((ULong *)&x)[1] |
287 |
#define word1(x) (x).L[1] |
297 |
#endif |
|
|
298 |
#else |
299 |
#ifdef IEEE_8087 |
300 |
#define word0(x) ((U*)&x)->L[1] |
301 |
#define word1(x) ((U*)&x)->L[0] |
302 |
#else |
303 |
#define word0(x) ((U*)&x)->L[0] |
304 |
#define word1(x) ((U*)&x)->L[1] |
305 |
#endif |
306 |
#define dval(x) ((U*)&x)->d |
307 |
#endif |
288 |
#endif |
308 |
|
289 |
|
309 |
/* The following definition of Storeinc is appropriate for MIPS processors. |
290 |
/* The following definition of Storeinc is appropriate for MIPS processors. |
310 |
* An alternative that might be better on some machines is |
291 |
* An alternative that might be better on some machines is |
311 |
* #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) |
|
|
312 |
*/ |
292 |
*/ |
313 |
#if defined(IEEE_8087) + defined(VAX) |
293 |
#define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) |
314 |
#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \ |
|
|
315 |
((unsigned short *)a)[0] = (unsigned short)c, a++) |
316 |
#else |
317 |
#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \ |
318 |
((unsigned short *)a)[1] = (unsigned short)c, a++) |
319 |
#endif |
320 |
|
294 |
|
321 |
/* #define P DBL_MANT_DIG */ |
295 |
/* #define P DBL_MANT_DIG */ |
322 |
/* Ten_pmax = floor(P*log(2)/log(5)) */ |
296 |
/* Ten_pmax = floor(P*log(2)/log(5)) */ |
Lines 440-450
typedef union { double d; ULong L[2]; }
Link Here
|
440 |
#ifdef RND_PRODQUOT |
414 |
#ifdef RND_PRODQUOT |
441 |
#define rounded_product(a,b) a = rnd_prod(a, b) |
415 |
#define rounded_product(a,b) a = rnd_prod(a, b) |
442 |
#define rounded_quotient(a,b) a = rnd_quot(a, b) |
416 |
#define rounded_quotient(a,b) a = rnd_quot(a, b) |
443 |
#ifdef KR_headers |
|
|
444 |
extern double rnd_prod(), rnd_quot(); |
445 |
#else |
446 |
extern double rnd_prod(double, double), rnd_quot(double, double); |
417 |
extern double rnd_prod(double, double), rnd_quot(double, double); |
447 |
#endif |
|
|
448 |
#else |
418 |
#else |
449 |
#define rounded_product(a,b) a *= b |
419 |
#define rounded_product(a,b) a *= b |
450 |
#define rounded_quotient(a,b) a /= b |
420 |
#define rounded_quotient(a,b) a /= b |
Lines 457-467
extern double rnd_prod(double, double),
Link Here
|
457 |
#define Pack_32 |
427 |
#define Pack_32 |
458 |
#endif |
428 |
#endif |
459 |
|
429 |
|
460 |
#ifdef KR_headers |
|
|
461 |
#define FFFFFFFF ((((unsigned long)0xffff)<<16)|(unsigned long)0xffff) |
462 |
#else |
463 |
#define FFFFFFFF 0xffffffffUL |
430 |
#define FFFFFFFF 0xffffffffUL |
464 |
#endif |
|
|
465 |
|
431 |
|
466 |
#ifdef NO_LONG_LONG |
432 |
#ifdef NO_LONG_LONG |
467 |
#undef ULLong |
433 |
#undef ULLong |
Lines 502-512
Bigint {
Link Here
|
502 |
|
468 |
|
503 |
static Bigint * |
469 |
static Bigint * |
504 |
Balloc |
470 |
Balloc |
505 |
#ifdef KR_headers |
|
|
506 |
(k) int k; |
507 |
#else |
508 |
(int k) |
471 |
(int k) |
509 |
#endif |
|
|
510 |
{ |
472 |
{ |
511 |
int x; |
473 |
int x; |
512 |
Bigint *rv; |
474 |
Bigint *rv; |
Lines 542-552
Balloc
Link Here
|
542 |
|
504 |
|
543 |
static void |
505 |
static void |
544 |
Bfree |
506 |
Bfree |
545 |
#ifdef KR_headers |
|
|
546 |
(v) Bigint *v; |
547 |
#else |
548 |
(Bigint *v) |
507 |
(Bigint *v) |
549 |
#endif |
|
|
550 |
{ |
508 |
{ |
551 |
if (v) { |
509 |
if (v) { |
552 |
ACQUIRE_DTOA_LOCK(0); |
510 |
ACQUIRE_DTOA_LOCK(0); |
Lines 561-571
y->wds*sizeof(Long) + 2*sizeof(int))
Link Here
|
561 |
|
519 |
|
562 |
static Bigint * |
520 |
static Bigint * |
563 |
multadd |
521 |
multadd |
564 |
#ifdef KR_headers |
|
|
565 |
(b, m, a) Bigint *b; int m, a; |
566 |
#else |
567 |
(Bigint *b, int m, int a) /* multiply by m and add a */ |
522 |
(Bigint *b, int m, int a) /* multiply by m and add a */ |
568 |
#endif |
|
|
569 |
{ |
523 |
{ |
570 |
int i, wds; |
524 |
int i, wds; |
571 |
#ifdef ULLong |
525 |
#ifdef ULLong |
Lines 618-628
multadd
Link Here
|
618 |
|
572 |
|
619 |
static Bigint * |
573 |
static Bigint * |
620 |
s2b |
574 |
s2b |
621 |
#ifdef KR_headers |
|
|
622 |
(s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9; |
623 |
#else |
624 |
(CONST char *s, int nd0, int nd, ULong y9) |
575 |
(CONST char *s, int nd0, int nd, ULong y9) |
625 |
#endif |
|
|
626 |
{ |
576 |
{ |
627 |
Bigint *b; |
577 |
Bigint *b; |
628 |
int i, k; |
578 |
int i, k; |
Lines 656-666
s2b
Link Here
|
656 |
|
606 |
|
657 |
static int |
607 |
static int |
658 |
hi0bits |
608 |
hi0bits |
659 |
#ifdef KR_headers |
|
|
660 |
(x) register ULong x; |
661 |
#else |
662 |
(register ULong x) |
609 |
(register ULong x) |
663 |
#endif |
|
|
664 |
{ |
610 |
{ |
665 |
register int k = 0; |
611 |
register int k = 0; |
666 |
|
612 |
|
Lines 690-700
hi0bits
Link Here
|
690 |
|
636 |
|
691 |
static int |
637 |
static int |
692 |
lo0bits |
638 |
lo0bits |
693 |
#ifdef KR_headers |
|
|
694 |
(y) ULong *y; |
695 |
#else |
696 |
(ULong *y) |
639 |
(ULong *y) |
697 |
#endif |
|
|
698 |
{ |
640 |
{ |
699 |
register int k; |
641 |
register int k; |
700 |
register ULong x = *y; |
642 |
register ULong x = *y; |
Lines 738-748
lo0bits
Link Here
|
738 |
|
680 |
|
739 |
static Bigint * |
681 |
static Bigint * |
740 |
i2b |
682 |
i2b |
741 |
#ifdef KR_headers |
|
|
742 |
(i) int i; |
743 |
#else |
744 |
(int i) |
683 |
(int i) |
745 |
#endif |
|
|
746 |
{ |
684 |
{ |
747 |
Bigint *b; |
685 |
Bigint *b; |
748 |
|
686 |
|
Lines 754-764
i2b
Link Here
|
754 |
|
692 |
|
755 |
static Bigint * |
693 |
static Bigint * |
756 |
mult |
694 |
mult |
757 |
#ifdef KR_headers |
|
|
758 |
(a, b) Bigint *a, *b; |
759 |
#else |
760 |
(Bigint *a, Bigint *b) |
695 |
(Bigint *a, Bigint *b) |
761 |
#endif |
|
|
762 |
{ |
696 |
{ |
763 |
Bigint *c; |
697 |
Bigint *c; |
764 |
int k, wa, wb, wc; |
698 |
int k, wa, wb, wc; |
Lines 866-876
mult
Link Here
|
866 |
|
800 |
|
867 |
static Bigint * |
801 |
static Bigint * |
868 |
pow5mult |
802 |
pow5mult |
869 |
#ifdef KR_headers |
|
|
870 |
(b, k) Bigint *b; int k; |
871 |
#else |
872 |
(Bigint *b, int k) |
803 |
(Bigint *b, int k) |
873 |
#endif |
|
|
874 |
{ |
804 |
{ |
875 |
Bigint *b1, *p5, *p51; |
805 |
Bigint *b1, *p5, *p51; |
876 |
int i; |
806 |
int i; |
Lines 923-933
pow5mult
Link Here
|
923 |
|
853 |
|
924 |
static Bigint * |
854 |
static Bigint * |
925 |
lshift |
855 |
lshift |
926 |
#ifdef KR_headers |
|
|
927 |
(b, k) Bigint *b; int k; |
928 |
#else |
929 |
(Bigint *b, int k) |
856 |
(Bigint *b, int k) |
930 |
#endif |
|
|
931 |
{ |
857 |
{ |
932 |
int i, k1, n, n1; |
858 |
int i, k1, n, n1; |
933 |
Bigint *b1; |
859 |
Bigint *b1; |
Lines 983-993
lshift
Link Here
|
983 |
|
909 |
|
984 |
static int |
910 |
static int |
985 |
cmp |
911 |
cmp |
986 |
#ifdef KR_headers |
|
|
987 |
(a, b) Bigint *a, *b; |
988 |
#else |
989 |
(Bigint *a, Bigint *b) |
912 |
(Bigint *a, Bigint *b) |
990 |
#endif |
|
|
991 |
{ |
913 |
{ |
992 |
ULong *xa, *xa0, *xb, *xb0; |
914 |
ULong *xa, *xa0, *xb, *xb0; |
993 |
int i, j; |
915 |
int i, j; |
Lines 1017-1027
cmp
Link Here
|
1017 |
|
939 |
|
1018 |
static Bigint * |
940 |
static Bigint * |
1019 |
diff |
941 |
diff |
1020 |
#ifdef KR_headers |
|
|
1021 |
(a, b) Bigint *a, *b; |
1022 |
#else |
1023 |
(Bigint *a, Bigint *b) |
942 |
(Bigint *a, Bigint *b) |
1024 |
#endif |
|
|
1025 |
{ |
943 |
{ |
1026 |
Bigint *c; |
944 |
Bigint *c; |
1027 |
int i, wa, wb; |
945 |
int i, wa, wb; |
Lines 1111-1125
diff
Link Here
|
1111 |
|
1029 |
|
1112 |
static double |
1030 |
static double |
1113 |
ulp |
1031 |
ulp |
1114 |
#ifdef KR_headers |
1032 |
(double dx) |
1115 |
(x) double x; |
|
|
1116 |
#else |
1117 |
(double x) |
1118 |
#endif |
1119 |
{ |
1033 |
{ |
1120 |
register Long L; |
1034 |
register Long L; |
1121 |
double a; |
1035 |
U x, a; |
1122 |
|
1036 |
|
|
|
1037 |
dval(x) = dx; |
1123 |
L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; |
1038 |
L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; |
1124 |
#ifndef Avoid_Underflow |
1039 |
#ifndef Avoid_Underflow |
1125 |
#ifndef Sudden_Underflow |
1040 |
#ifndef Sudden_Underflow |
Lines 1153-1167
ulp
Link Here
|
1153 |
|
1068 |
|
1154 |
static double |
1069 |
static double |
1155 |
b2d |
1070 |
b2d |
1156 |
#ifdef KR_headers |
|
|
1157 |
(a, e) Bigint *a; int *e; |
1158 |
#else |
1159 |
(Bigint *a, int *e) |
1071 |
(Bigint *a, int *e) |
1160 |
#endif |
|
|
1161 |
{ |
1072 |
{ |
1162 |
ULong *xa, *xa0, w, y, z; |
1073 |
ULong *xa, *xa0, w, y, z; |
1163 |
int k; |
1074 |
int k; |
1164 |
double d; |
1075 |
U d; |
1165 |
#ifdef VAX |
1076 |
#ifdef VAX |
1166 |
ULong d0, d1; |
1077 |
ULong d0, d1; |
1167 |
#else |
1078 |
#else |
Lines 1223-1234
b2d
Link Here
|
1223 |
|
1134 |
|
1224 |
static Bigint * |
1135 |
static Bigint * |
1225 |
d2b |
1136 |
d2b |
1226 |
#ifdef KR_headers |
1137 |
(double dd, int *e, int *bits) |
1227 |
(d, e, bits) double d; int *e, *bits; |
|
|
1228 |
#else |
1229 |
(double d, int *e, int *bits) |
1230 |
#endif |
1231 |
{ |
1138 |
{ |
|
|
1139 |
U d; |
1232 |
Bigint *b; |
1140 |
Bigint *b; |
1233 |
int de, k; |
1141 |
int de, k; |
1234 |
ULong *x, y, z; |
1142 |
ULong *x, y, z; |
Lines 1237-1242
d2b
Link Here
|
1237 |
#endif |
1145 |
#endif |
1238 |
#ifdef VAX |
1146 |
#ifdef VAX |
1239 |
ULong d0, d1; |
1147 |
ULong d0, d1; |
|
|
1148 |
#endif |
1149 |
dval(d) = dd; |
1150 |
#ifdef VAX |
1240 |
d0 = word0(d) >> 16 | word0(d) << 16; |
1151 |
d0 = word0(d) >> 16 | word0(d) << 16; |
1241 |
d1 = word1(d) >> 16 | word1(d) << 16; |
1152 |
d1 = word1(d) >> 16 | word1(d) << 16; |
1242 |
#else |
1153 |
#else |
Lines 1361-1373
d2b
Link Here
|
1361 |
|
1272 |
|
1362 |
static double |
1273 |
static double |
1363 |
ratio |
1274 |
ratio |
1364 |
#ifdef KR_headers |
|
|
1365 |
(a, b) Bigint *a, *b; |
1366 |
#else |
1367 |
(Bigint *a, Bigint *b) |
1275 |
(Bigint *a, Bigint *b) |
1368 |
#endif |
|
|
1369 |
{ |
1276 |
{ |
1370 |
double da, db; |
1277 |
U da, db; |
1371 |
int k, ka, kb; |
1278 |
int k, ka, kb; |
1372 |
|
1279 |
|
1373 |
dval(da) = b2d(a, &ka); |
1280 |
dval(da) = b2d(a, &ka); |
Lines 1453-1463
static CONST double tinytens[] = { 1e-16
Link Here
|
1453 |
|
1360 |
|
1454 |
static int |
1361 |
static int |
1455 |
match |
1362 |
match |
1456 |
#ifdef KR_headers |
|
|
1457 |
(sp, t) char **sp, *t; |
1458 |
#else |
1459 |
(CONST char **sp, CONST char *t) |
1363 |
(CONST char **sp, CONST char *t) |
1460 |
#endif |
|
|
1461 |
{ |
1364 |
{ |
1462 |
int c, d; |
1365 |
int c, d; |
1463 |
CONST char *s = *sp; |
1366 |
CONST char *s = *sp; |
Lines 1475-1485
match
Link Here
|
1475 |
#ifndef No_Hex_NaN |
1378 |
#ifndef No_Hex_NaN |
1476 |
static void |
1379 |
static void |
1477 |
hexnan |
1380 |
hexnan |
1478 |
#ifdef KR_headers |
1381 |
(U *rvp, CONST char **sp) |
1479 |
(rvp, sp) double *rvp; CONST char **sp; |
|
|
1480 |
#else |
1481 |
(double *rvp, CONST char **sp) |
1482 |
#endif |
1483 |
{ |
1382 |
{ |
1484 |
ULong c, x[2]; |
1383 |
ULong c, x[2]; |
1485 |
CONST char *s; |
1384 |
CONST char *s; |
Lines 1529-1539
hexnan
Link Here
|
1529 |
|
1428 |
|
1530 |
double |
1429 |
double |
1531 |
kjs_strtod |
1430 |
kjs_strtod |
1532 |
#ifdef KR_headers |
|
|
1533 |
(s00, se) CONST char *s00; char **se; |
1534 |
#else |
1535 |
(CONST char *s00, char **se) |
1431 |
(CONST char *s00, char **se) |
1536 |
#endif |
|
|
1537 |
{ |
1432 |
{ |
1538 |
#ifdef Avoid_Underflow |
1433 |
#ifdef Avoid_Underflow |
1539 |
int scale; |
1434 |
int scale; |
Lines 1541-1547
kjs_strtod
Link Here
|
1541 |
int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, |
1436 |
int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, |
1542 |
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; |
1437 |
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; |
1543 |
CONST char *s, *s0, *s1; |
1438 |
CONST char *s, *s0, *s1; |
1544 |
double aadj, aadj1, adj, rv, rv0; |
1439 |
double aadj, aadj1, adj; |
|
|
1440 |
U aadj2, rv, rv0; |
1545 |
Long L; |
1441 |
Long L; |
1546 |
ULong y, z; |
1442 |
ULong y, z; |
1547 |
Bigint *bb = NULL, *bb1 = NULL, *bd = NULL, *bd0 = NULL, *bs = NULL, *delta = NULL; |
1443 |
Bigint *bb = NULL, *bb1 = NULL, *bd = NULL, *bd0 = NULL, *bs = NULL, *delta = NULL; |
Lines 2302-2308
kjs_strtod
Link Here
|
2302 |
aadj = z; |
2198 |
aadj = z; |
2303 |
aadj1 = dsign ? aadj : -aadj; |
2199 |
aadj1 = dsign ? aadj : -aadj; |
2304 |
} |
2200 |
} |
2305 |
word0(aadj1) += (2*P+1)*Exp_msk1 - y; |
2201 |
dval(aadj2) = aadj1; |
|
|
2202 |
word0(aadj2) += (2*P+1)*Exp_msk1 - y; |
2203 |
aadj1 = dval(aadj2); |
2306 |
} |
2204 |
} |
2307 |
adj = aadj1 * ulp(dval(rv)); |
2205 |
adj = aadj1 * ulp(dval(rv)); |
2308 |
dval(rv) += adj; |
2206 |
dval(rv) += adj; |
Lines 2419-2429
kjs_strtod
Link Here
|
2419 |
|
2317 |
|
2420 |
static int |
2318 |
static int |
2421 |
quorem |
2319 |
quorem |
2422 |
#ifdef KR_headers |
|
|
2423 |
(b, S) Bigint *b, *S; |
2424 |
#else |
2425 |
(Bigint *b, Bigint *S) |
2320 |
(Bigint *b, Bigint *S) |
2426 |
#endif |
|
|
2427 |
{ |
2321 |
{ |
2428 |
int n; |
2322 |
int n; |
2429 |
ULong *bx, *bxe, q, *sx, *sxe; |
2323 |
ULong *bx, *bxe, q, *sx, *sxe; |
Lines 2540-2550
quorem
Link Here
|
2540 |
#endif |
2434 |
#endif |
2541 |
|
2435 |
|
2542 |
static char * |
2436 |
static char * |
2543 |
#ifdef KR_headers |
|
|
2544 |
rv_alloc(i) int i; |
2545 |
#else |
2546 |
rv_alloc(int i) |
2437 |
rv_alloc(int i) |
2547 |
#endif |
|
|
2548 |
{ |
2438 |
{ |
2549 |
int j, k, *r; |
2439 |
int j, k, *r; |
2550 |
|
2440 |
|
Lines 2563-2573
rv_alloc(int i)
Link Here
|
2563 |
} |
2453 |
} |
2564 |
|
2454 |
|
2565 |
static char * |
2455 |
static char * |
2566 |
#ifdef KR_headers |
|
|
2567 |
nrv_alloc(s, rve, n) char *s, **rve; int n; |
2568 |
#else |
2569 |
nrv_alloc(CONST char *s, char **rve, int n) |
2456 |
nrv_alloc(CONST char *s, char **rve, int n) |
2570 |
#endif |
|
|
2571 |
{ |
2457 |
{ |
2572 |
char *rv, *t; |
2458 |
char *rv, *t; |
2573 |
|
2459 |
|
Lines 2585-2595
nrv_alloc(CONST char *s, char **rve, int
Link Here
|
2585 |
*/ |
2471 |
*/ |
2586 |
|
2472 |
|
2587 |
void |
2473 |
void |
2588 |
#ifdef KR_headers |
|
|
2589 |
kjs_freedtoa(s) char *s; |
2590 |
#else |
2591 |
kjs_freedtoa(char *s) |
2474 |
kjs_freedtoa(char *s) |
2592 |
#endif |
|
|
2593 |
{ |
2475 |
{ |
2594 |
Bigint *b = (Bigint *)((int *)s - 1); |
2476 |
Bigint *b = (Bigint *)((int *)s - 1); |
2595 |
b->maxwds = 1 << (b->k = *(int*)b); |
2477 |
b->maxwds = 1 << (b->k = *(int*)b); |
Lines 2636-2647
kjs_freedtoa(char *s)
Link Here
|
2636 |
|
2518 |
|
2637 |
char * |
2519 |
char * |
2638 |
kjs_dtoa |
2520 |
kjs_dtoa |
2639 |
#ifdef KR_headers |
2521 |
(double dd, int mode, int ndigits, int *decpt, int *sign, char **rve) |
2640 |
(d, mode, ndigits, decpt, sign, rve) |
|
|
2641 |
double d; int mode, ndigits, *decpt, *sign; char **rve; |
2642 |
#else |
2643 |
(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) |
2644 |
#endif |
2645 |
{ |
2522 |
{ |
2646 |
/* Arguments ndigits, decpt, sign are similar to those |
2523 |
/* Arguments ndigits, decpt, sign are similar to those |
2647 |
of ecvt and fcvt; trailing zeros are suppressed from |
2524 |
of ecvt and fcvt; trailing zeros are suppressed from |
Lines 2686-2692
kjs_dtoa
Link Here
|
2686 |
ULong x; |
2563 |
ULong x; |
2687 |
#endif |
2564 |
#endif |
2688 |
Bigint *b, *b1, *delta, *mlo = NULL, *mhi, *S; |
2565 |
Bigint *b, *b1, *delta, *mlo = NULL, *mhi, *S; |
2689 |
double d2, ds, eps; |
2566 |
U d, d2, eps; |
|
|
2567 |
double ds; |
2690 |
char *s, *s0; |
2568 |
char *s, *s0; |
2691 |
#ifdef Honor_FLT_ROUNDS |
2569 |
#ifdef Honor_FLT_ROUNDS |
2692 |
int rounding; |
2570 |
int rounding; |
Lines 2702-2707
kjs_dtoa
Link Here
|
2702 |
} |
2580 |
} |
2703 |
#endif |
2581 |
#endif |
2704 |
|
2582 |
|
|
|
2583 |
dval(d) = dd; |
2705 |
if (word0(d) & Sign_bit) { |
2584 |
if (word0(d) & Sign_bit) { |
2706 |
/* set sign for everything, including 0's and NaNs */ |
2585 |
/* set sign for everything, including 0's and NaNs */ |
2707 |
*sign = 1; |
2586 |
*sign = 1; |