function old new delta
zbc_num_p 440 424 -16
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
size_t i, powrdx, resrdx;
bool neg;
- if (b->rdx) RETURN_STATUS(bc_error("non integer number"));
+// GNU bc does not allow 2^2.0. We do.
+// if (b->rdx) RETURN_STATUS(bc_error("non integer number"));
if (b->len == 0) {
bc_num_one(c);
neg = b->neg;
b->neg = false;
-
s = zbc_num_ulong(b, &pow);
+ b->neg = neg;
if (s) RETURN_STATUS(s);
+ // b is not used beyond this point
bc_num_init(©, a->len);
bc_num_copy(©, a);
scale = a->rdx * pow;
}
- b->neg = neg;
for (powrdx = a->rdx; !(pow & 1); pow >>= 1) {
powrdx <<= 1;