当前位置 : 主页 > 编程语言 > java >

判断单双精度

来源:互联网 收集:自由互联 发布时间:2021-06-28
gistfile1.txt if(str.charAt(str.length()-1)=='f'||str.charAt(str.length()-1)=='F'){System.out.println(MathDemo.round(Float.parseFloat(str))+"f");}else {System.out.println(MathDemo.round(Double.parseDouble(str)));}
gistfile1.txt
if(str.charAt(str.length()-1)=='f'||str.charAt(str.length()-1)=='F'){
			System.out.println(MathDemo.round(Float.parseFloat(str))+"f");
		}else {
			System.out.println(MathDemo.round(Double.parseDouble(str)));
		}
网友评论