From f5b7505a79865065d58278be5da185476d547e31 Mon Sep 17 00:00:00 2001 From: Michal Utlak Date: Wed, 20 Mar 2024 15:24:14 +0100 Subject: [PATCH] divide fix --- a1/program.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/a1/program.c b/a1/program.c index 6e6eb7f..2ad0c08 100644 --- a/a1/program.c +++ b/a1/program.c @@ -1,5 +1,6 @@ #include #include +#include char pole[100]; @@ -27,16 +28,14 @@ int main() { else { printf("Nulou sa nedeli!\n"); return 0; - break; } break; default: printf("Zle znamienko!\n"); return 0; - break; } - if ((int)vysledok == ocakavany_vysledok) { + if (fabs(vysledok - (float)ocakavany_vysledok) < 0.0001) { printf("OK\n"); } else { printf("ZLE\n");