From 0c04b0fdbd475c663726c767cd4679518d42b160 Mon Sep 17 00:00:00 2001 From: fdai7968 Date: Thu, 8 Feb 2024 16:51:13 +0000 Subject: [PATCH] refactoring: if angle is 0 return 1 for cosinus --- src/trig_functions/trig_functions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/trig_functions/trig_functions.c b/src/trig_functions/trig_functions.c index ffae719..7f12327 100644 --- a/src/trig_functions/trig_functions.c +++ b/src/trig_functions/trig_functions.c @@ -7,7 +7,8 @@ double calculate_sin(double angle) { } double calculate_cos(double angle) { - return cos(angle); + if (angle==0) return 1; + else return cos(angle); } double calculate_tan(double angle) {