zaokruhlenie desatinnych cisel

This commit is contained in:
Aleš Novysedlák 2025-03-10 13:43:10 +01:00
parent ddf1f313ed
commit ed35d59346

View File

@ -65,7 +65,7 @@ int main() {
total = divided(total, atof(equation[i])); total = divided(total, atof(equation[i]));
break; break;
case '=': case '=':
/*if (total == atof(equation[i]))*/if (fabs(total - atof(equation[i])) < 1e-6) { /*if (total == atof(equation[i]))*/if (fabs((round(total*100)/100) - atof(equation[i])) < 1e-6) {
strcpy(output[output_length], "OK"); strcpy(output[output_length], "OK");
output_length++; output_length++;
} }