diff options
author | aiju <devnull@localhost> | 2015-12-08 19:43:22 +0100 |
---|---|---|
committer | aiju <devnull@localhost> | 2015-12-08 19:43:22 +0100 |
commit | 609a9922adac98516b33d67dc98b432ac9c10cc9 (patch) | |
tree | b413edc28412778e24474e7eccbe432f4362cd0d /sys/src/libmp | |
parent | 87abbc649f9064660128b840ef3aabad3e55abce (diff) |
mp: fix bug in mplogic.c; update mkfile
Diffstat (limited to 'sys/src/libmp')
-rw-r--r-- | sys/src/libmp/port/mkfile | 1 | ||||
-rw-r--r-- | sys/src/libmp/port/mplogic.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/sys/src/libmp/port/mkfile b/sys/src/libmp/port/mkfile index b0bdf67d5..bfa9d457c 100644 --- a/sys/src/libmp/port/mkfile +++ b/sys/src/libmp/port/mkfile @@ -38,6 +38,7 @@ FILES=\ mptoui\ mptov\ mptouv\ + mplogic\ ALLOFILES=${FILES:%=%.$O} # cull things in the per-machine directories from this list diff --git a/sys/src/libmp/port/mplogic.c b/sys/src/libmp/port/mplogic.c index a5839073c..22b61827b 100644 --- a/sys/src/libmp/port/mplogic.c +++ b/sys/src/libmp/port/mplogic.c @@ -138,7 +138,6 @@ mptrunc(mpint *b, int n, mpint *r) r->top = DIGITS(n); d = n / Dbits; m = n % Dbits; - r->sign = 1; if(b->sign == -1){ c = 1; for(i = 0; i <= r->top; i++){ @@ -162,6 +161,7 @@ mptrunc(mpint *b, int n, mpint *r) if(m != 0) r->p[d] = b->p[d] & (1<<m)-1; } + r->sign = 1; mpnorm(r); } |