python 判断是不是小数

转化成整型后,判断跟原数值是否相同,若不相同则不是小数。

for i in range(1,10):
    print(math.log(i,2),' ',int(math.log(i,2))==math.log(i,2))

原文地址:https://www.cnblogs.com/lolybj/p/13426359.html