I am trying to create a program that checks if an equation creates a whole number answer but the equation creates floating point numbers that won't compare to integers. When it gets to the first integer, which is supposed to be 390625 it prints it as 390625.0 and it doesn't leave the while loop when it gets to that number.
I'm new to programming so please keep it simple.
from myro import *
from math import *
def main():
z = 3
a = 2
b = 2
x = 3
y = 3
lim = 25
c = (a**x + b**y)**(1.0/z)
while int(c) != c:
while z <= lim:
while a <= lim:
while b <= lim:
while x <= lim:
while y <= lim:
c = (a**x + b**y)**(1.0/z)
print a, b, c, x, y, z
y = y + 1
y = 3
print a, b, c, x, y, z
x = x + 1
x = 3
print a, b, c, x, y, z
b = b + 1
b = 3
print a, b, c, x, y, z
a = a + 1
a = 3
print a, b, c, x, y, z
z = z + 1
print "code cycle complete. no numbers meet criteria"
print str(a) + "^" + str(x) + " + " + str(b) + "^" + str(y) + " = " + str(c) + "^" + str(z)
main()