New submission from Mauricio de Alencar: The following code demonstrates an inconsistency of this method in dealing with zeros after the decimal mark.
from decimal import Context context = Context(prec=2) for x in [100., 10., 1., 0.1]: print(context.create_decimal_from_float(x), context.create_decimal_from_float(4.56*x)) Produces the output: 1.0E+2 4.6E+2 10 46 1 4.6 0.10 0.46 Line 3 is inconsistent. It should be "1.0 4.6". ---------- messages: 210131 nosy: mdealencar priority: normal severity: normal status: open title: Context.create_decimal_from_float() inconsistent precision for zeros after decimal mark type: behavior versions: Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20502> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com