This seems to be simple but I cannot find a way to do it. I need to show whether the cube root of an integer is integer or not. I used is_integer()
float method in Python 3.4 but that wasn't successful. As
x = (3**3)**(1/3.0)
is_integer(x)
True
but
x = (4**3)**(1/3.0)
is_integer(x)
False
I tried x%1 == 0
,x == int(x)
and isinstance(x,int)
with no success.
I'd appreciate any comment.
abs((x-round(x))/x) < epsilon
(for some small epsilon).