From eb421bd257cd747c27656df3c14ae899e154f09f Mon Sep 17 00:00:00 2001 From: fdai7848 Date: Fri, 2 Feb 2024 17:55:01 +0100 Subject: [PATCH] add test for logarithmus with decimals --- test/test_logarithmus.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test_logarithmus.c b/test/test_logarithmus.c index 6461bba..e39c8c9 100644 --- a/test/test_logarithmus.c +++ b/test/test_logarithmus.c @@ -65,5 +65,19 @@ void test_logarithmic_function_with_integers(void){ TEST_ASSERT_DOUBLE_WITHIN(0.000001, 2.0, r4); } +void test_logarithmic_function_with_decimals(void){ + double r1, r2, r3, r4; + + r1 = logX(0.1289, 26.5); + r2 = logX(7.64, 8.314); + r3 = logX(3.0, 2.4587); + r4 = logX(9.0, 94.6584); + + TEST_ASSERT_DOUBLE_WITHIN(0.000001, -1.599607, r1); + TEST_ASSERT_DOUBLE_WITHIN(0.000001, 1.041577, r2); + TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.818881, r3); + TEST_ASSERT_DOUBLE_WITHIN(0.000001, 2.070919, r4); +} + #endif // TEST \ No newline at end of file