diff --git a/du3/program.c b/du3/program.c index 144be99..8dac2b5 100644 --- a/du3/program.c +++ b/du3/program.c @@ -78,8 +78,8 @@ int main() { total = divided(total, atof(equation[i])); break; case '=': - total = round(total * 100) / 100; - if (fabs(total - atof(equation[i])) < 1e-6) { + //total = round(total * 100) / 100; + if (fabs((round(total * 100) / 100) - atof(equation[i])) < 1e-6) { strcpy(output[output_length], "OK"); output_length++; } else { @@ -99,6 +99,7 @@ int main() { sign = !sign; } memset(equation, 0, sizeof(equation)); + //printf("%f - %f\n",total, (round(total * 100) / 100)); } for (int i=0; i