fltadd.cpp 264 B

12345678910111213
  1. // fltadd.cpp -- precision problems with float
  2. #include <iostream>
  3. int main()
  4. {
  5. using namespace std;
  6. float a = 2.34E+22f;
  7. float b = a + 1.0f;
  8. cout << "a = " << a << endl;
  9. cout << "b - a = " << b - a << endl;
  10. // cin.get();
  11. return 0;
  12. }