From 80461d1273c41002d1fba01bf8c2d9f42a49fb2a Mon Sep 17 00:00:00 2001 From: fdai7848 Date: Thu, 1 Feb 2024 08:36:50 +0100 Subject: [PATCH] add tests for decimal base and decimal exponent --- test/test_exponent.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/test_exponent.c b/test/test_exponent.c index 0439cac..f0a09d0 100644 --- a/test/test_exponent.c +++ b/test/test_exponent.c @@ -67,15 +67,23 @@ void test_DoubleBase_for_negative_decimal_exponent(void){ r2 = expIN(-0.5, 2.0); r3 = expIN(-0.12923, 10.0); - printf("%lf\n",r1); - printf("%lf\n",r2); - printf("%lf\n",r3); - TEST_ASSERT_DOUBLE_WITHIN(0.0001, 0.871685, r1); TEST_ASSERT_DOUBLE_WITHIN(0.0001, 0.707106, r2); TEST_ASSERT_DOUBLE_WITHIN(0.0001, 0.742625, r3); } +void test_DoubleDecimalBase_for_negative_decimal_exponent(void){ + float r1, r2, r3; + + r1 = expIN(-0.5, 6.2315); + r2 = expIN(-0.1937, 9.2309); + r3 = expIN(-2.2145, 22.9983); + + TEST_ASSERT_DOUBLE_WITHIN(0.0001, 0.400593, r1); + TEST_ASSERT_DOUBLE_WITHIN(0.0001, 0.650177, r2); + TEST_ASSERT_DOUBLE_WITHIN(0.0001, 0.000964, r3); +} + void test_Exponent_with_positive_number(void){ double r1, r2, r3;