libmp: fix mptouv behaviour to match mptoui

This commit is contained in:
aiju 2018-12-06 09:32:20 +00:00
parent 17b80cbcf1
commit 64d0d3b8ac

View file

@ -33,11 +33,11 @@ mptouv(mpint *b)
uvlong v; uvlong v;
int s; int s;
if(b->top == 0) if(b->top == 0 || b->sign < 0)
return 0LL; return 0LL;
if(b->top > VLDIGITS) if(b->top > VLDIGITS)
return MAXVLONG; return -1LL;
v = 0ULL; v = 0ULL;
for(s = 0; s < b->top; s++) for(s = 0; s < b->top; s++)