mpmagadd: force output sign +1 always

This commit is contained in:
aiju 2018-05-04 21:41:16 +00:00
parent 8dc43a951c
commit 35065b9127

View file

@ -21,10 +21,12 @@ mpmagadd(mpint *b1, mpint *b2, mpint *sum)
m = b2->top;
if(n == 0){
mpassign(mpzero, sum);
sum->sign = 1;
return;
}
if(m == 0){
mpassign(b1, sum);
sum->sign = 1;
return;
}
mpbits(sum, (n+1)*Dbits);