[Python-ideas] Python Float Update
liik.joonas at gmail.com
Mon Jun 1 17:12:52 CEST 2015
what i meant was not a literal that results in a Decimal, what i meant was
a special literal proxy object that usualyl acts like a float except you
can ask for its original string form.
flit = 1.3
flit*3 == float(flit)*3
str(flit) == '1.3'
thus in cases where the intermediate float conversion loses precision you
can get at the original string that the programmer actually typed in.
Decimal constructors are one case that woudl probably like to use the
original string whenever possible to avoid conversion losses,
but by no means are they the only ones.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas