[Python-bugs-list] [ python-Bugs-725916 ] Tkinter.DoubleVar data corruption
SourceForge.net
noreply@sourceforge.net
Tue, 22 Apr 2003 18:33:30 -0700
Bugs item #725916, was opened at 2003-04-22 19:01
Message generated for change (Comment added) made by tim_one
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=725916&group_id=5470
Category: Tkinter
Group: None
>Status: Closed
>Resolution: Duplicate
Priority: 5
Submitted By: Lonnie Princehouse (caprice_of_mind)
Assigned to: Nobody/Anonymous (nobody)
Summary: Tkinter.DoubleVar data corruption
Initial Comment:
Tkinter.DoubleVar is performing the equivalent of float(str
(x)), resulting in the unnecessary amputation of a few
siginificant digits because str() does not return enough
digits to represent the full range of a 64-bit float.
Example:
x = 0.33333333333333098
from Tkinter import *
y = DoubleVar(Tk())
y.set(x)
# x == 0.33333333333333098
# y.get() == 0.33333333333300003
if y.get() == x:
print "Good!"
else:
print "Bad!"
----------------------------------------------------------------------
>Comment By: Tim Peters (tim_one)
Date: 2003-04-22 21:33
Message:
Logged In: YES
user_id=31435
This is a duplicate of bug 721171, already fixed for 2.3.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=725916&group_id=5470