@vncpetrov/

ComparingFloatsAndDoubles

C++

No description

fork
loading
Files
  • main.cpp

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.44371903767223264","path":"main.cpp","file":{"path":"main.cpp","content":{"asEncoding":{"base64":"I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7IAogIGRvdWJsZSBkMSA9IDEwMCAtIDk5Ljk5OwogIGRvdWJsZSBkMiA9IDEwIC0gOS45OTsKCiAgY291dCA8PCBib29sYWxwaGEgPDwgKGQxID09IGQyKSA8PCBlbmRsOwoKICByZXR1cm4gMDsKfQ=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
using namespace std;

int main() { 
  double d1 = 100 - 99.99;
  double d2 = 10 - 9.99;

  cout << boolalpha << (d1 == d2) << endl;

  return 0;
}