int sign;
int tmp;
- if (e1->flt_exp == 0 && e1->m1 == 0 && e1->m2 == 0 &&
- e2->flt_exp == 0 && e2->m1 == 0 && e2->m2 == 0) {
+ if (e1->m1 == 0 && e1->m2 == 0 &&
+ e2->m1 == 0 && e2->m2 == 0) {
return 0;
}
sign = e1->flt_sign ? -1 : 1;
*/
for (j = 0; j <= 3; j++, u_p++) {
long q_est, temp;
+ long v1 = v[1];
if (j == 2) lp++;
if (u_p[0] == 0 && u_p[1] < v[1]) continue;
q_est = temp;
}
else if (temp >= 0) {
- q_est = temp / (long)v[1];
+ q_est = temp / v1;
}
else {
long rem;
- q_est = (0x7FFFFFFF/(long)v[1])+((temp&0x7FFFFFFF)/(long)v[1]);
- rem = (0x7FFFFFFF%(long)v[1])+((temp&0x7FFFFFFF)%(long)v[1])+1;
- while (rem > (long)v[1]) {
+ q_est = (0x7FFFFFFF/v1)+((temp&0x7FFFFFFF)/v1);
+ rem = (0x7FFFFFFF%v1)+((temp&0x7FFFFFFF)%v1)+1;
+ while (rem > v1) {
q_est++;
- rem -= v[1];
+ rem -= v1;
}
}
- temp -= q_est * (long)v[1];
+ temp -= q_est * v1;
while (!(temp&0xFFFF0000) &&
ucmp((long)v[2]*q_est,(temp<<16)+(long)u_p[2]) > 0) {
q_est--;
- temp += v[1];
+ temp += v1;
}
/* Now, according to Knuth, we have an estimate of the
quotient, that is either correct or one too big, but
k = (tmp >> 16) & 0xFFFF;
}
k += borrow;
- borrow = u_p[0] < k;
+ borrow = (long)u_p[0] < k;
u_p[0] -= k;
if (borrow) {
/* So, this does not happen often; the estimate
was one too big; correct this
*/
- *lp |= (j & 1) ? (q_est - 1) : ((q_est-1)<<16);
+ q_est--;
borrow = 0;
for (i = maxv; i > 0; i--) {
long tmp
}
u_p[0] += borrow;
}
- else *lp |= (j & 1) ? q_est : (q_est<<16);
+ *lp |= (j & 1) ? q_est : (q_est<<16);
}
}
e3->m1 = result[0];
while (divsz >= BIGSZ) {
flt_mul(&x, neg ? &r_big_10pow[BIGSZ-1] : &big_10pow[BIGSZ-1],&x);
divsz -= BIGSZ-1;
- flt_chk(e);
- if (flt_status != 0) return;
}
flt_mul(&x, (neg ? r_big_10pow : big_10pow) + divsz, e);
}