Java 代码实现 0.9, 9 的循环
public class Main { public static void main(String[] args) { double num = 0.9; while (true) { num = (num * 10) % 1; if (num == 0.9) { System.out.println('0.9, 9 循环出现!'); break; } } } }
原文地址: http://www.cveoy.top/t/topic/lYgl 著作权归作者所有。请勿转载和采集!