From 98d95b8c49d7d75982d70213a12bbd07b007f7e6 Mon Sep 17 00:00:00 2001 From: fdai7968 Date: Thu, 8 Feb 2024 16:56:26 +0000 Subject: [PATCH] refactoring: if angle is 0 return 0 for tangens --- 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 7f12327..186a4fe 100644 --- a/src/trig_functions/trig_functions.c +++ b/src/trig_functions/trig_functions.c @@ -12,5 +12,6 @@ double calculate_cos(double angle) { } double calculate_tan(double angle) { - return tan(angle); + if (angle==0) return 0; + else return tan(angle); }