Essential C++ / Floating point arithmetic

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <string> int main(int argc, char **argv) { double a = 0.1; double b = 0.2; double c = 0.3; if (a + b == c) { // This never prints on IEEE754-compliant machines std::cout << "This Computer is Magic!" << std::endl; } else { std::cout << "This Computer is pretty normal, all things considered." << std::endl; } }
Editor Settings
Theme
Key bindings
Full width
Lines