Hi
Is there a way to check if a float is a whole number eg 10.0, 7.0 or somthing.0
I'm doing problem 5 on project eular
Mayby I have the complete wrong idea here is my code:
numbertobetested = 0.0
loop2 = 1
while loop2 == 1:
numbertobetested = numbertobetested+1.0
a = 0.0
loop = 1
while loop == 1:
a = a+1.0
if a <=10:
c = numbertobetested/a
if (c % 2 == 0): #This is not what I want I need to test if
if a == 10: # c is a whole number.
print numbertobetested
loop = 0
loop2 = 0
else:
loop = 0
Any help will be appreciated.
Thanks
P.S sorry for hard to read codeing(coding?)