Tim Peters added the comment: Oops! The `D2**e` in that code should be `pow(D2, e)`, to make it use the correct decimal context. ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue27761> _______________________________________