flt_status maintained for flt_str2flt()
This commit is contained in:
parent
328b5011af
commit
662c87a579
|
@ -200,16 +200,20 @@ add_exponent(e, exp)
|
||||||
int neg = exp < 0;
|
int neg = exp < 0;
|
||||||
int divsz, modsz;
|
int divsz, modsz;
|
||||||
flt_arith x;
|
flt_arith x;
|
||||||
|
int status;
|
||||||
|
|
||||||
if (neg) exp = -exp;
|
if (neg) exp = -exp;
|
||||||
divsz = exp / SMALLSZ;
|
divsz = exp / SMALLSZ;
|
||||||
modsz = exp % SMALLSZ;
|
modsz = exp % SMALLSZ;
|
||||||
flt_mul(e, (neg ? r_10pow : s10pow) + modsz, &x);
|
flt_mul(e, (neg ? r_10pow : s10pow) + modsz, &x);
|
||||||
|
if (flt_status) status = flt_status;
|
||||||
while (divsz >= BIGSZ) {
|
while (divsz >= BIGSZ) {
|
||||||
flt_mul(&x, neg ? &r_big_10pow[BIGSZ-1] : &big_10pow[BIGSZ-1],&x);
|
flt_mul(&x, neg ? &r_big_10pow[BIGSZ-1] : &big_10pow[BIGSZ-1],&x);
|
||||||
|
if (flt_status) status = flt_status;
|
||||||
divsz -= BIGSZ-1;
|
divsz -= BIGSZ-1;
|
||||||
}
|
}
|
||||||
flt_mul(&x, (neg ? r_big_10pow : big_10pow) + divsz, e);
|
flt_mul(&x, (neg ? r_big_10pow : big_10pow) + divsz, e);
|
||||||
|
if (flt_status) status = flt_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
flt_str2flt(s, e)
|
flt_str2flt(s, e)
|
||||||
|
|
Loading…
Reference in a new issue