libmp: fix mptouv behaviour to match mptoui
This commit is contained in:
parent
17b80cbcf1
commit
64d0d3b8ac
1 changed files with 2 additions and 2 deletions
|
@ -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++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue