|
|
@ -85,6 +85,21 @@ void test_ln_with_positive_number(void){ |
|
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 0.916290, r3); |
|
|
|
} |
|
|
|
|
|
|
|
void test_ln_with_zero_and_negative_numbers(void){ |
|
|
|
double r1, r2, r3; |
|
|
|
|
|
|
|
r1 = logN(0.0, 0.000001); |
|
|
|
r2 = logN(-1.0, 0.000001); |
|
|
|
r3 = logN(-2.5, 0.000001); |
|
|
|
|
|
|
|
printf("Result 1: %lf\n", r1); |
|
|
|
printf("Result 2: %lf\n", r2); |
|
|
|
printf("Result 3: %lf\n", r3); |
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_DOUBLE(-1.0, r1); |
|
|
|
TEST_ASSERT_EQUAL_DOUBLE(-1.0, r2); |
|
|
|
TEST_ASSERT_EQUAL_DOUBLE(-1.0, r3); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif // TEST |