From 0d884ee53c566bac76d9153d1a6fafef2eabda7f Mon Sep 17 00:00:00 2001 From: fdai7968 Date: Thu, 8 Feb 2024 16:50:18 +0000 Subject: [PATCH] refactoring: if angle is 0 return 0 for sin --- 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 8eec384..ffae719 100644 --- a/src/trig_functions/trig_functions.c +++ b/src/trig_functions/trig_functions.c @@ -2,7 +2,8 @@ #include double calculate_sin(double angle) { - return sin(angle); + if (angle==0) return 0; + else return sin(angle); } double calculate_cos(double angle) {