?? prog2_07.cpp
字號:
// Program 2.7 Floating point errors
#include <iostream>
using std::cout;
using std::endl;
int main() {
float value1 = 0.1f;
float value2 = 2.1f;
value1 -= 0.09f; // Should be 0.01
value2 -= 2.09f; // Should be 0.01
cout << value1 - value2 << endl; // Should output zero
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -