This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author facundobatista
Recipients facundobatista, mark.dickinson, rhettinger, steven.daprano
Date 2009-01-10.21:43:09
SpamBayes Score 0.00142346
Marked as misclassified No
Message-id <>
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::


where ``floatNumber`` is the float number origin of the construction.  

    >>> Decimal.from_float(1.1)
Date User Action Args
2009-01-10 21:43:12facundobatistasetrecipients: + facundobatista, rhettinger, mark.dickinson, steven.daprano
2009-01-10 21:43:11facundobatistasetmessageid: <>
2009-01-10 21:43:10facundobatistalinkissue4796 messages
2009-01-10 21:43:09facundobatistacreate