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.0014234626
Marked as misclassified No
Message-id <1231623791.77.0.0575493527582.issue4796@psf.upfronthosting.co.za>
In-reply-to
Content
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')
"""
History
Date User Action Args
2009-01-10 21:43:12facundobatistasetrecipients: + facundobatista, rhettinger, mark.dickinson, steven.daprano
2009-01-10 21:43:11facundobatistasetmessageid: <1231623791.77.0.0575493527582.issue4796@psf.upfronthosting.co.za>
2009-01-10 21:43:10facundobatistalinkissue4796 messages
2009-01-10 21:43:09facundobatistacreate