From 168f0b444fdafa97bc85429fa83c517259a01953 Mon Sep 17 00:00:00 2001 From: Michal Utlak Date: Wed, 20 Mar 2024 15:41:07 +0100 Subject: [PATCH] fabs() modification --- a1/program.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/a1/program.c b/a1/program.c index 548bbfa..49dd097 100644 --- a/a1/program.c +++ b/a1/program.c @@ -36,7 +36,9 @@ int main() { break; } - if (fabs(vysledok - ocakavany_vysledok) < 0.0001) { + printf("Expected result: %.4f, Actual result: %.4f\n", ocakavany_vysledok, vysledok); + + if (fabs(vysledok - ocakavany_vysledok) < 0.01) { printf("OK\n"); } else { printf("ZLE\n");