fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. float x = 0.0f;
  6. float y = -0.0f;
  7. cout << x << endl;
  8. cout << y << endl;
  9.  
  10. if(x == y){
  11. printf("x==y");
  12. }
  13. if(x > y){
  14. printf("x>y");
  15. }
  16. if(x < y){
  17. printf("x<y");
  18. }
  19.  
  20. if(x == 0.0f){
  21. printf("x==0.0f");
  22. }
  23. if(x > 0.0f){
  24. printf("x>0.0f");
  25. }
  26. if(x < 0.0f){
  27. printf("x<0.0f");
  28. }
  29.  
  30. if(y == -0.0f){
  31. printf("y == -0.0f");
  32. }
  33. if(y > -0.0f){
  34. printf("y > -0.0f");
  35. }
  36. if(y < -0.0f){
  37. printf("y < -0.0f");
  38. }
  39.  
  40. if(0.0f == -0.0f){
  41. printf("0.0f == -0.0f");
  42. }
  43. if(0.0f > -0.0f){
  44. printf("0.0f > -0.0f");
  45. }
  46. if(0.0f < -0.0f){
  47. printf("0.0f < -0.0f");
  48. }
  49.  
  50. return 0;
  51. }
Success #stdin #stdout 0s 4376KB
stdin
Standard input is empty
stdout
0
-0
x==yx==0.0fy == -0.0f0.0f == -0.0f