Als «floating-accuracy» getaggte Fragen

75
Warum 0,1 + 0,2 == 0,3 in D?

assert(0.1 + 0.2 != 0.3); // shall be true ist meine Lieblingsprüfung, dass eine Sprache native Gleitkomma-Arithmetik verwendet. C ++ #include <cstdio> int main() { printf("%d\n", (0.1 + 0.2 != 0.3)); return 0; } Ausgabe: 1 http://ideone.com/ErBMd Python print(0.1 + 0.2 != 0.3) Ausgabe: True...