# include # include # include using namespace std; int main ( ) // // ADD_SMALL allows us to specify an increment Y to be added // to the value X = 1.23456789. // // Since a float only has about 8 digits of accuracy, we will get // the answers we expect when Y = 1, 0.1, 0.01, 0.001, but as Y // decreases, the answers will start to look bad. And when Y gets // very small, it can't be added to X at all. // { float x; float y; float z; x = 1.23456789; cout << "ADD_SMALL:\n"; cout << " Enter small Y to add to X = 1.23456789.\n"; cin >> y; z = x + y; cout << "\n"; cout << setprecision(12) << x << " + " << y << " = " << z << "\n"; return 0; }