On Sat, Mar 8, 2014 at 11:54 AM, Guido van Rossum
I'll try to respond to Mark Dickinson's second message (and nothing else
that happens in the thread since last night), because (a) it concisely summarizes his position and (b) brings up a new strawman.
On Sat, Mar 8, 2014 at 2:01 AM, Mark Dickinson
wrote: On Sat, Mar 8, 2014 at 9:43 AM, Mark Dickinson
I see three sane options for float to Decimal conversion:
1. Raise an exception. 2. Round to the nearest Decimal value using the current context for
wrote: that round operation.
3. Do what we're currently doing, and do an exact conversion.
I think you're writing this entirely from the POV of an expert in floating point. And I'm glad we have experts like you around! I don't consider myself an expert at all, but I do think I have something to bring to the table -- insight the experience of non-expert users.
This reminded me a discussion we had with Mark Dickinson on the bug tracker: "When a user is entering 0.6112295, she means 0.6112295, not 0x1.38f312b1b36bdp-1 or 0.61122949999999998116351207499974407255649566650390625 which are exact values of the underlying binary representation of 0.6112295." http://bugs.python.org/issue8860#msg108601 The topic was the conversion from binary floats to timedelta which is effectively a fixed point decimal with 6 decimal places after the point.