bc: make 2^1000000 interruptible faster
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
68cc0a676e
commit
f359e004b0
@ -2039,6 +2039,11 @@ static BcStatus bc_num_p(BcNum *a, BcNum *b, BcNum *restrict c, size_t scale)
|
|||||||
powrdx <<= 1;
|
powrdx <<= 1;
|
||||||
s = bc_num_mul(©, ©, ©, powrdx);
|
s = bc_num_mul(©, ©, ©, powrdx);
|
||||||
if (s) goto err;
|
if (s) goto err;
|
||||||
|
// It is too slow to handle ^C only after entire "2^1000000" completes
|
||||||
|
if (G_interrupt) {
|
||||||
|
s = BC_STATUS_FAILURE;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bc_num_copy(c, ©);
|
bc_num_copy(c, ©);
|
||||||
@ -2054,6 +2059,11 @@ static BcStatus bc_num_p(BcNum *a, BcNum *b, BcNum *restrict c, size_t scale)
|
|||||||
s = bc_num_mul(c, ©, c, resrdx);
|
s = bc_num_mul(c, ©, c, resrdx);
|
||||||
if (s) goto err;
|
if (s) goto err;
|
||||||
}
|
}
|
||||||
|
// It is too slow to handle ^C only after entire "2^1000000" completes
|
||||||
|
if (G_interrupt) {
|
||||||
|
s = BC_STATUS_FAILURE;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (neg) {
|
if (neg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user