Advertisement
Guest User

Untitled

a guest
May 27th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1.  
  2. // Obviously, this code heavily depends on the platform you compile for and run on.
  3.  
  4. #include <iostream>
  5.  
  6. int main()
  7. {
  8. using namespace std;
  9.  
  10. float zero_plus = 1e-200;
  11. float zero_minus = -1e-200;
  12.  
  13. cout << showpos
  14. << "Positive zero: " << zero_plus << endl
  15. << "Negative zero: " << zero_minus << endl
  16.  
  17. << "Reciprocal of +0: " << 1/zero_plus << endl
  18. << "Reciprocal of -0: " << 1/zero_minus << endl
  19.  
  20. << "Product of -0 and +0: " << zero_plus * zero_minus << endl
  21. << "Product of -0 and -0: " << zero_minus * zero_minus << endl;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement