On Thu, May 29, 2008 at 6:15 AM, Kent Johnson <[EMAIL PROTECTED]> wrote:

>  if int(round(cubed_root)) ** 3 == n
> so the cube is done with integer arithmetic instead of floating point.

Compare:
In [1]: 550919 ** 3
Out[1]: 167210386801801559L

In [2]: 550919.0 ** 3
Out[2]: 1.6721038680180157e+017

The cubes you are working with are too large to be represented
accurately with floating point numbers.

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to