summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-05-31 18:49:24 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-05-31 18:49:24 (GMT)
commit0271766c8869f270ed80996e02df6c52b6972bb8 (patch)
treee4db158a7bfa361d2c9fb1d9e0b761c88e2d8836 /Modules
parent4d3e0a695aec69b6c3f6638a65bd7469cd4fd568 (diff)
downloadcpython-0271766c8869f270ed80996e02df6c52b6972bb8.zip
cpython-0271766c8869f270ed80996e02df6c52b6972bb8.tar.gz
cpython-0271766c8869f270ed80996e02df6c52b6972bb8.tar.bz2
Use workctx instead of ctx for cosmetic reasons. Also zero-pad the result
in the simple path (not correctly rounded but faster).
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_decimal/libmpdec/mpdecimal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c
index 801b9a1..f6fefb9 100644
--- a/Modules/_decimal/libmpdec/mpdecimal.c
+++ b/Modules/_decimal/libmpdec/mpdecimal.c
@@ -4168,7 +4168,7 @@ mpd_qexp(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
if (mpd_isspecial(result) || mpd_iszerocoeff(result) ||
mpd_qcmp(&t1, &t2, status) == 0) {
workctx.clamp = ctx->clamp;
- _mpd_zeropad(result, ctx, status);
+ _mpd_zeropad(result, &workctx, status);
mpd_check_underflow(result, &workctx, status);
mpd_qfinalize(result, &workctx, status);
break;
@@ -4182,6 +4182,7 @@ mpd_qexp(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
}
else {
_mpd_qexp(result, a, &workctx, status);
+ _mpd_zeropad(result, &workctx, status);
mpd_check_underflow(result, &workctx, status);
mpd_qfinalize(result, &workctx, status);
}