Код: Выделить всё
#include
using namespace std;
int main() {
double d = 0; // d == 0
// d = 2.0f - 2.0f; // d == 0
// d = 2.0f - 2.0f + 1.0e-320; // d != 0
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79667514/comparing-initialized-floating-point-variable-to-zero-again[/url]
Мобильная версия