gonzui


Format: Advanced Search

SearchGoogle itResults 1 - 1 of 1 for funcall:dval from t2ex/bsd_source/lib/libc/src_bsd/stdlib/strtod.c (0.01 seconds)
t2ex
bsd_source/lib/libc/src_bsd/stdlib/strtod.c - 41.4KB - 1,105 lines
143:         sign = nz0 = nz = decpt = 0;
144:         dval(&rv) = 0.;
145:         for(s = s00;;s++) switch(*s) {
349: k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; 350: dval(&rv) = y; 351: if (k > 9) {
355: #endif 356: dval(&rv) = tens[k - 9] * dval(&rv) + z; 357: }
379: #endif 380: /* rv = */ rounded_product(dval(&rv), tens[e]); 381: goto ret;
396: e -= i; 397: dval(&rv) *= tens[i]; 398: #ifdef VAX
403: word0(&rv) -= P*Exp_msk1; 404: /* rv = */ rounded_product(dval(&rv), tens[e]); 405: if ((word0(&rv) & Exp_mask)
409: #else 410: /* rv = */ rounded_product(dval(&rv), tens[e]); 411: #endif
423: #endif 424: /* rv = */ rounded_quotient(dval(&rv), tens[-e]); 425: goto ret;
455: if ( (i = e1 & 15) !=0) 456: dval(&rv) *= tens[i]; 457: if (e1 &= ~15) {
478: /* set overflow bit */ 479: dval(&rv0) = 1e300; 480: dval(&rv0) *= dval(&rv0); 481: #endif
501: if (e1 & 1) 502: dval(&rv) *= bigtens[j]; 503: /* The last multiplication could overflow. */ 504: word0(&rv) -= P*Exp_msk1; 505: dval(&rv) *= bigtens[j]; 506: if ((z = word0(&rv) & Exp_mask)
521: if ( (i = e1 & 15) !=0) 522: dval(&rv) /= tens[i]; 523: if (e1 >>= 4) {
530: if (e1 & 1) 531: dval(&rv) *= tinytens[j]; 532: if (scale && (j = 2*P + 1 - ((word0(&rv) & Exp_mask)
547: if (e1 & 1) 548: dval(&rv) *= tinytens[j]; 549: /* The last multiplication could underflow. */ 550: dval(&rv0) = dval(&rv); 551: dval(&rv) *= tinytens[j]; 552: if (!dval(&rv)) { 553: dval(&rv) = 2.*dval(&rv0); 554: dval(&rv) *= tinytens[j]; 555: #endif 556: if (!dval(&rv)) { 557: undfl: 558: dval(&rv) = 0.; 559: goto range_err;
584: Bcopy(bd, bd0); 585: bb = d2b(dval(&rv), &bbe, &bbbits); /* rv = bb * 2^bbe */ 586: if (bb == NULL)
700: if (dsign) { 701: dval(&adj) = 1.; 702: goto apply_adj;
705: else if (!dsign) { 706: dval(&adj) = -1.; 707: if (!word1(&rv)
719: if (cmp(delta, bs) <= 0) 720: dval(&adj) = -0.5; 721: }
732: word0(&rv) += P*Exp_msk1; 733: dval(&rv) += adj*ulp(&rv); 734: word0(&rv) -= P*Exp_msk1;
738: #endif /*Avoid_Underflow*/ 739: dval(&rv) += adj.d*ulp(&rv); 740: }
742: } 743: dval(&adj) = ratio(delta, bs); 744: if (adj.d < 1.) 745: dval(&adj) = 1.; 746: if (adj.d <= 0x7ffffffe) {
751: y++; 752: dval(&adj) = y; 753: }
761: word0(&rv) += P*Exp_msk1; 762: dval(&adj) *= ulp(&rv); 763: if (dsign) 764: dval(&rv) += adj; 765: else 766: dval(&rv) -= adj; 767: word0(&rv) -= P*Exp_msk1;
771: #endif /*Avoid_Underflow*/ 772: dval(&adj) *= ulp(&rv); 773: if (dsign) {
775: goto ovfl; 776: dval(&rv) += adj.d; 777: } 778: else 779: dval(&rv) -= adj.d; 780: goto cont;
897: #ifdef Avoid_Underflow 898: dval(&rv) += sulp(&rv, scale); 899: #else 900: dval(&rv) += ulp(&rv); 901: #endif
904: #ifdef Avoid_Underflow 905: dval(&rv) -= sulp(&rv, scale); 906: #else 907: dval(&rv) -= ulp(&rv); 908: #endif 909: #ifndef Sudden_Underflow 910: if (!dval(&rv)) 911: goto undfl;
921: if (dsign) 922: aadj = dval(&aadj1) = 1.; 923: else if (word1(&rv) || word0(&rv) & Bndry_mask) {
928: aadj = 1.; 929: dval(&aadj1) = -1.; 930: }
938: aadj *= 0.5; 939: dval(&aadj1) = -aadj; 940: }
943: aadj *= 0.5; 944: dval(&aadj1) = dsign ? aadj : -aadj; 945: #ifdef Check_FLT_ROUNDS
947: case 2: /* towards +infinity */ 948: dval(&aadj1) -= 0.5; 949: break;
951: case 3: /* towards -infinity */ 952: dval(&aadj1) += 0.5; 953: }
955: if (Flt_Rounds == 0) 956: dval(&aadj1) += 0.5; 957: #endif /*Check_FLT_ROUNDS*/
963: if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) { 964: dval(&rv0) = dval(&rv); 965: word0(&rv) -= P*Exp_msk1; 966: dval(&adj) = dval(&aadj1) * ulp(&rv); 967: dval(&rv) += dval(&adj); 968: if ((word0(&rv) & Exp_mask) >=
985: aadj = z; 986: dval(&aadj1) = dsign ? aadj : -aadj; 987: }
989: } 990: dval(&adj) = dval(&aadj1) * ulp(&rv); 991: dval(&rv) += dval(&adj); 992: #else
994: if ((word0(&rv) & Exp_mask) <= P*Exp_msk1) { 995: dval(&rv0) = dval(&rv); 996: word0(&rv) += P*Exp_msk1; 997: dval(&adj) = dval(&aadj1) * ulp(&rv); 998: dval(&rv) += dval(&adj); 999: #ifdef IBM
1015: else { 1016: dval(&adj) = dval(&aadj1) * ulp(&rv); 1017: dval(&rv) += dval(&adj); 1018: }
1027: if (y <= (P-1)*Exp_msk1 && aadj > 1.) { 1028: dval(&aadj1) = (double)(int)(aadj + 0.5); 1029: if (!dsign) 1030: dval(&aadj1) = -dval(&aadj1); 1031: } 1032: dval(&adj) = dval(&aadj1) * ulp(&rv); 1033: dval(&rv) += adj; 1034: #endif /*Sudden_Underflow*/
1070: word1(&rv0) = 0; 1071: dval(&rv0) += 1.; 1072: }
1080: word1(&rv0) = 0; 1081: dval(&rv) *= dval(&rv0); 1082: #ifndef NO_ERRNO
1095: /* set underflow bit */ 1096: dval(&rv0) = 1e-300; 1097: dval(&rv0) *= dval(&rv0); 1098: }
1102: *se = (char *)s; 1103: return sign ? -dval(&rv) : dval(&rv); 1104: }