Browse Source

add test case for negative exponent with integer base

master
fdai7848 11 months ago
parent
commit
b9a1ad99da
  1. 16
      test/test_exponent.c

16
test/test_exponent.c

@ -60,6 +60,22 @@ void test_DoubleDecimalBase_for_positive_decimal_exponent(void){
TEST_ASSERT_DOUBLE_WITHIN(0.0001, 1.332474, r3); TEST_ASSERT_DOUBLE_WITHIN(0.0001, 1.332474, r3);
} }
void test_DoubleBase_for_negative_decimal_exponent(void){
float r1, r2, r3;
r1 = expIN(-0.125, 3.0);
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_Exponent_with_positive_number(void){ void test_Exponent_with_positive_number(void){
double r1, r2, r3; double r1, r2, r3;

Loading…
Cancel
Save