Version: Python 2.7
I am trying to check if the number x, in this case 64, is a cube. I check if the root-cube of the number is an integer:
root3 = math.pow(64, (1/3.0))
print(root3)
print(root3.is_integer())
Which prints:
4.0
False
Which is wrong, since 4.0 is an integer. In comparison, using 4.0 directly:
print((4.0).is_integer())
Which prints True
.
How can I make sure the root cube of 64 is considered as a whole float?