|
@ -143,8 +143,8 @@ void test_addition_signfloatingnumber(void) { |
|
|
unsigned int expected[2] = { 0, 1 }; |
|
|
unsigned int expected[2] = { 0, 1 }; |
|
|
number[0].floating = 1, number[1].floating = -1; |
|
|
number[0].floating = 1, number[1].floating = -1; |
|
|
|
|
|
|
|
|
result[0] = s(number[0].integer); |
|
|
|
|
|
result[1] = s(number[1].integer); |
|
|
|
|
|
|
|
|
result[0] = sign(number[0].integer); |
|
|
|
|
|
result[1] = sign(number[1].integer); |
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[0], result[0]); |
|
|
TEST_ASSERT_EQUAL_UINT(expected[0], result[0]); |
|
|
TEST_ASSERT_EQUAL_UINT(expected[1], result[1]); |
|
|
TEST_ASSERT_EQUAL_UINT(expected[1], result[1]); |
|
@ -155,11 +155,11 @@ void test_addition_precisionfloatingnumber(void) { |
|
|
number[0].floating = 0, number[1].floating = -34753168, number[2].floating = 75613594, number[3].floating = -0.00000044568721, number[4].floating = 0.0000004796123; |
|
|
number[0].floating = 0, number[1].floating = -34753168, number[2].floating = 75613594, number[3].floating = -0.00000044568721, number[4].floating = 0.0000004796123; |
|
|
unsigned int expected[5] = { ( number[0].integer << 9) >> 9 , ( number[1].integer << 9) >> 9, ( number[2].integer << 9) >> 9, ( number[3].integer << 9) >> 9, ( number[4].integer << 9) >> 9}; |
|
|
unsigned int expected[5] = { ( number[0].integer << 9) >> 9 , ( number[1].integer << 9) >> 9, ( number[2].integer << 9) >> 9, ( number[3].integer << 9) >> 9, ( number[4].integer << 9) >> 9}; |
|
|
|
|
|
|
|
|
result[0] = m( number[0].integer ); |
|
|
|
|
|
result[1] = m( number[1].integer ); |
|
|
|
|
|
result[2] = m( number[2].integer ); |
|
|
|
|
|
result[3] = m( number[3].integer ); |
|
|
|
|
|
result[4] = m( number[4].integer ); |
|
|
|
|
|
|
|
|
result[0] = precision( number[0].integer ); |
|
|
|
|
|
result[1] = precision( number[1].integer ); |
|
|
|
|
|
result[2] = precision( number[2].integer ); |
|
|
|
|
|
result[3] = precision( number[3].integer ); |
|
|
|
|
|
result[4] = precision( number[4].integer ); |
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[0], result[0]); |
|
|
TEST_ASSERT_EQUAL_UINT(expected[0], result[0]); |
|
|
TEST_ASSERT_EQUAL_UINT(expected[1], result[1]); |
|
|
TEST_ASSERT_EQUAL_UINT(expected[1], result[1]); |
|
|