单精度双精度的取值范围 单精度:可展示小数点后七位,小数点后六位准确,第七位不准确 双进度:可展示小数点后十六位,小数点后十五位准确,第十六位不准确 例如: public class Deom { public static void main(String[] args) { float a = 3.1415926f; double b = 3.1415926575856566; System.out.println(a+"\n"+b); } } 输出结果为: 3.1415925 3.1415926575856568