diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-10-16 18:44:52 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-10-16 18:44:52 -0700 |
commit | b2dfc50f1c98417166d647538d7d5ecd6178dd4c (patch) | |
tree | a60accd6d167928c824bc639517337b6a66ec688 | |
parent | bb043799e946ad141d3012fdd5b247dfa812efc5 (diff) | |
download | txr-b2dfc50f1c98417166d647538d7d5ecd6178dd4c.tar.gz txr-b2dfc50f1c98417166d647538d7d5ecd6178dd4c.tar.bz2 txr-b2dfc50f1c98417166d647538d7d5ecd6178dd4c.zip |
* arith.c (gcd, lognot): Bugfix: bignum results
in fixnum range not normalized.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | arith.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,5 +1,10 @@ 2014-10-16 Kaz Kylheku <kaz@kylheku.com> + * arith.c (gcd, lognot): Bugfix: bignum results + in fixnum range not normalized. + +2014-10-16 Kaz Kylheku <kaz@kylheku.com> + * match.c (dest_bind): More detailed log message for variable mismatch. @@ -1389,7 +1389,7 @@ val gcd(val anum, val bnum) if (mp_gcd(mp(anum), mp(bnum), mp(n)) != MP_OKAY) goto bad; - return n; + return normalize(n); inval: uw_throwf(error_s, lit("gcd: non-integral operands ~s ~s"), anum, bnum, nao); @@ -1753,7 +1753,7 @@ val lognot(val a, val bits) b = make_bignum(); if (mp_comp(mp(a), mp(b)) != MP_OKAY) goto bad; - return b; + return normalize(b); default: uw_throwf(error_s, lit("lognot: non-integral operand ~s"), a, nao); } |