We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a4222f commit 0887d82Copy full SHA for 0887d82
missing/dtoa.c
@@ -699,6 +699,8 @@ i2b(int i)
699
return b;
700
}
701
702
+#define Bzero_p(b) (!(b)->x[0] && (b)->wds <= 1)
703
+
704
static Bigint *
705
mult(Bigint *a, Bigint *b)
706
{
@@ -715,6 +717,13 @@ mult(Bigint *a, Bigint *b)
715
717
#endif
716
718
719
720
+ if (Bzero_p(a) || Bzero_p(b)) {
721
+ c = Balloc(0);
722
+ c->wds = 1;
723
+ c->x[0] = 0;
724
+ return c;
725
+ }
726
727
if (a->wds < b->wds) {
728
c = a;
729
a = b;
@@ -862,6 +871,8 @@ lshift(Bigint *b, int k)
862
871
Bigint *b1;
863
872
ULong *x, *x1, *xe, z;
864
873
874
+ if (!k || Bzero_p(b)) return b;
875
865
876
#ifdef Pack_32
866
877
n = k >> 5;
867
878
#else
0 commit comments