兩個(gè)整數(shù)相除得到小數(shù)(JAVA)
結(jié)果完全不一樣public class test{
public static void main(String[] args){
double x = 1/4;
System.out.println(x+"");
}
}
public class test{
public static void main(String[] args){
double x = (double)1/4;
System.out.println(x+"");
}
}
是變笨了還是。。。
基礎(chǔ)不牢,唯一的解釋。
posted on 2007-11-24 15:13 sooxin 閱讀(2846) 評論(0) 編輯 收藏 所屬分類: JAVA