jwenjian / ghiblog

GitHub Issues Blog, powered by GitHub Issues and GitHub Actions
https://1link.fun
350 stars 47 forks source link

判断1/n是否为无限小数__张洪基-CSDN博客 #250

Open jwenjian opened 4 years ago

jwenjian commented 4 years ago

Card 判断1/n是否为无限小数__张洪基-CSDN博客 added the to the Python list in the 遇见 board at June 5, 2020 at 05:05PM
 
> 原理: 只要被除数n可以转化为2的次幂或者转化为2与5的组合 即为有限小数 否则无限小数 bool iint(int n) { if(n==1) return false; else if(n%2==0) { return iint(n/2); } else if(n%5==0) { return iint(n/5); } else return true; }
 
---
 
View on Trello