@vncpetrov/

ComparingFloatsAndDoubles2

C++

No description

fork
loading
Files
  • main.cpp

This Plugin Crashed!

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

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

  cout << setprecision(17) << d1 << endl;
  cout << setprecision(17) << d2 << endl;

  return 0;
}