[Tutor] Need more precise digits
01 Dec 2001 16:23:13 -0800
On Sat, 2001-12-01 at 16:10, Danny Yoo wrote:
> On Sat, 1 Dec 2001, Mike Yuen wrote:
> > I've trying to calculate an average and it looks like i'm losing some
> > precision in digits.
> > For example: i've got the following formula
> > avgsize = float(totalsize/groups)
> The problem is one of timing: by the time float() works on its argument,
> we've already lost precision. In Python,
> >>> float(1/2)
So either 1 or 2 needs to be a float; but what's with the 1 in the
following (python2 on redhat 7.2):
Isn't the last one correct?