[Tutor] a probably stupid question

Sean 'Shaleh' Perry shalehperry@attbi.com
Wed, 15 May 2002 15:21:55 -0700 (PDT)


> 
> Why cannot I assign as 0.x value to a variable without this (curious)
> rounding? And why 1.3/2.0 must be rounded?
> Being too big to be a bug, I am sure I do not understand the real problem.
> Thank you, Sirs. Any help is much appreciated.
> 

>>> a = 0.234
>>> a
0.23400000000000001
>>> repr(a)
'0.23400000000000001'
>>> str(a)
'0.234'
>>> 1.3
1.3
>>> 1.3/2.0
0.65000000000000002
>>> b = 1.3/2.0
>>> b
0.65000000000000002
>>> str(b)
'0.65'
>>> 

Not sure if that helps any, but if you look through the replease notes this may
be enough of a clue to find the reason.