From dde66d2b33e0b6daf8f43ea9be3da53c66d869bd Mon Sep 17 00:00:00 2001 From: fdai7848 Date: Thu, 1 Feb 2024 08:09:08 +0100 Subject: [PATCH] Add tests for decimal exponent with decimal base --- test/test_exponent.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test_exponent.c b/test/test_exponent.c index 04d8725..b05bd28 100644 --- a/test/test_exponent.c +++ b/test/test_exponent.c @@ -56,6 +56,22 @@ void test_DoubleBase_for_positive_decimal_exponent(void){ TEST_ASSERT_DOUBLE_WITHIN(0.0001, 1.414213, r3); } +void test_DoubleDecimalBase_for_positive_decimal_exponent(void){ + float r1, r2, r3; + + r1 = expIN(0.31, 0.413); + r2 = expIN(0.5, 3.13432); + r3 = expIN(0.124, 10.1231); + + printf("Result 1: %f\n", r1); + printf("Result 2: %f\n", r2); + printf("\nResult 3: %lf\n\n", r3); + + TEST_ASSERT_DOUBLE_WITHIN(0.0001, 0.760229, r1); + TEST_ASSERT_DOUBLE_WITHIN(0.0001, 1.770401, r2); + TEST_ASSERT_DOUBLE_WITHIN(0.0001, 1.332474, r3); +} + void test_Exponent_with_positive_number(void){ double r1, r2, r3;