changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: libmp: fix mptouv behaviour to match mptoui

changeset 6941: 73f77dc6f0c6
parent 6940: 9155f29f0eab
child 6942: b76d6262d1e3
author: aiju
date: Thu, 06 Dec 2018 09:32:20 +0000
files: sys/src/libmp/port/mptouv.c
description: libmp: fix mptouv behaviour to match mptoui
     1.1--- a/sys/src/libmp/port/mptouv.c
     1.2+++ b/sys/src/libmp/port/mptouv.c
     1.3@@ -33,11 +33,11 @@ mptouv(mpint *b)
     1.4 	uvlong v;
     1.5 	int s;
     1.6 
     1.7-	if(b->top == 0)
     1.8+	if(b->top == 0 || b->sign < 0)
     1.9 		return 0LL;
    1.10 
    1.11 	if(b->top > VLDIGITS)
    1.12-		return MAXVLONG;
    1.13+		return -1LL;
    1.14 
    1.15 	v = 0ULL;
    1.16 	for(s = 0; s < b->top; s++)