Facundo Batista <[email protected]> added the comment:
Raymond, Mark, thanks for this work!
I'd include the following in the PEP (under the "from float"
discussion), what do you think?
"""
Update: The .from_float() method was added to Python 2.7 and 3.1
versions, providing lossless and exact conversion from float to Decimal
(see issue 4796 [7]_ for further information).
It has the following syntax::
Decimal.from_float(floatNumber)
where ``floatNumber`` is the float number origin of the construction.
Example::
>>> Decimal.from_float(1.1)
Decimal('1.100000000000000088817841970012523233890533447265625')
"""
----------
nosy: +facundobatista
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue4796>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com