|
|
@ -82,12 +82,12 @@ void test_logarithmic_function_with_decimals(void){ |
|
|
|
void test_logarithmic_function_to_base_10(void){ |
|
|
|
double r1, r2, r3, r4, r5, r6; |
|
|
|
|
|
|
|
r1 = logDec(100.0); |
|
|
|
r2 = logDec(100.6479); |
|
|
|
r3 = logDec(10.587); |
|
|
|
r4 = logDec(4.341); |
|
|
|
r5 = logDec(0.34979); |
|
|
|
r6 = logDec(1.0); |
|
|
|
r1 = log10(100.0); |
|
|
|
r2 = log10(100.6479); |
|
|
|
r3 = log10(10.587); |
|
|
|
r4 = log10(4.341); |
|
|
|
r5 = log10(0.34979); |
|
|
|
r6 = log10(1.0); |
|
|
|
|
|
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 2.0, r1); |
|
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 2.002804, r2); |
|
|
@ -100,12 +100,12 @@ void test_logarithmic_function_to_base_10(void){ |
|
|
|
void test_logarithmic_function_to_base_2(void){ |
|
|
|
double r1, r2, r3, r4, r5, r6; |
|
|
|
|
|
|
|
r1 = logBin(1024.0); |
|
|
|
r2 = logBin(1024.8742); |
|
|
|
r3 = logBin(900.587); |
|
|
|
r4 = logBin(78.341); |
|
|
|
r5 = logBin(0.34979); |
|
|
|
r6 = logBin(1.0); |
|
|
|
r1 = log2(1024.0); |
|
|
|
r2 = log2(1024.8742); |
|
|
|
r3 = log2(900.587); |
|
|
|
r4 = log2(78.341); |
|
|
|
r5 = log2(0.34979); |
|
|
|
r6 = log2(1.0); |
|
|
|
|
|
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 10.0, r1); |
|
|
|
TEST_ASSERT_DOUBLE_WITHIN(0.000001, 10.001231, r2); |
|
|
|