On Wed, May 28, 2008 at 8:43 PM, Robert William Hanks <[EMAIL PROTECTED]> wrote: > > Need ti find out whem a number o this form i**3+j**3+1 is acube. > tryed a simple brute force code but, why this not work? > > def iscube(n): > cubed_root = n**(1/3.0) > if round(cubed_root)**3 == n:
Try if int(round(cubed_root)) ** 3 == n so the cube is done with integer arithmetic instead of floating point. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor