From c37fec2514c415e6dd5db7535b8d007108c2ce4f Mon Sep 17 00:00:00 2001 From: fdai7764 Date: Sun, 28 Jan 2024 13:34:33 +0100 Subject: [PATCH] added test for sin of 0 as well as corresponding functionality --- src/main/py/trigonometry.py | 5 ++++- src/test/py/test_trigonometry.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/py/trigonometry.py b/src/main/py/trigonometry.py index b33c8bb..cd98d97 100644 --- a/src/main/py/trigonometry.py +++ b/src/main/py/trigonometry.py @@ -12,4 +12,7 @@ def pi_approx_leibniz(precision): return multiply(result, 4) def rad2deg(radNumber): - return (radNumber * 180) / math.pi \ No newline at end of file + return (radNumber * 180) / math.pi + +def sin_approx_bhaskara(radNumber): + return radNumber \ No newline at end of file diff --git a/src/test/py/test_trigonometry.py b/src/test/py/test_trigonometry.py index 10e870e..b7324ff 100644 --- a/src/test/py/test_trigonometry.py +++ b/src/test/py/test_trigonometry.py @@ -36,6 +36,9 @@ class MyTestCase(unittest.TestCase): delta *= -1 self.assertLess(delta, 0.01) + def test_sin_0_should_be_0(self): + self.assertEqual(sin_approx_bhaskara(0), 0) + if __name__ == '__main__': unittest.main()