➜

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 tim.peters
Recipients
Date 2003-04-14.15:32:08
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
DoubleVar.set() (I think) goes thru PyObject_Str(), 
causing precision loss for doubles:

>>> import Tkinter
>>> import math
>>> x = Tkinter.DoubleVar(Tkinter.Tk())
>>> x.set(math.pi)
>>> x.get()
3.1415926535900001   # not good
>>> math.pi
3.1415926535897931   # original precision
>>> eval(str(math.pi))
3.1415926535900001   # reproduces Tk result
>>>

Reported on c.l.py.  Guido says you may know how to 
create a "native" Tcl/Tk double in this case instead.
History
Date User Action Args
2007-08-23 14:12:27adminlinkissue721171 messages
2007-08-23 14:12:27admincreate