超過6位小數(shù)怎么寫,這樣對么
#include <stdio.h>
int main(){
????float b =1.825622335;
? ? double?c =1.825622335;
????printf("%f",b);
????printf("%f",c);
????return 0;
}
#include <stdio.h>
int main(){
????float b =1.825622335;
? ? double?c =1.825622335;
????printf("%f",b);
????printf("%f",c);
????return 0;
}
2018-08-03
舉報
2018-08-03
你可以指定輸出的小數(shù)多少位,例如,你可以把兩個數(shù)都用printf("%.12f",c);這樣的輸出了,float的會和原來的數(shù)不一樣,但是double就不會
2018-08-03
為啥得到只能是6位