Visual C++ 表示浮點數的時候,最好加上 setprecision 來設定有效位數才會正確 March 03, 2008 #include <iostream> #include <iomanip> using namespace std; int main(){ cout << 1.23456789e+8 << endl; cout << setprecision(20) << 1.23456789e+8 << endl; } Share Get link Facebook X Pinterest Email Other Apps Labels C++ Share Get link Facebook X Pinterest Email Other Apps Comments
Comments