|
|
@ -176,11 +176,11 @@ void test_addition_exponentfloatingnumber(void) |
|
|
|
number[0].floating = 0, number[1].floating = -762134982, number[2].floating = 47621349, number[3].floating = -0.0000078961354, number[4].floating = 0.00001568943; |
|
|
|
unsigned int expected[5] = { ( number[0].integer << 1) >> 24 , ( number[1].integer << 1) >> 24, ( number[2].integer << 1) >> 24, ( number[3].integer << 1) >> 24, ( number[4].integer << 1) >> 24}; |
|
|
|
|
|
|
|
result[0] = e( number[0].integer ); |
|
|
|
result[1] = e( number[1].integer ); |
|
|
|
result[2] = e( number[2].integer ); |
|
|
|
result[3] = e( number[3].integer ); |
|
|
|
result[4] = e( number[4].integer ); |
|
|
|
result[0] = exponent( number[0].integer ); |
|
|
|
result[1] = exponent( number[1].integer ); |
|
|
|
result[2] = exponent( number[2].integer ); |
|
|
|
result[3] = exponent( number[3].integer ); |
|
|
|
result[4] = exponent( number[4].integer ); |
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[0], result[0]); |
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[1], result[1]); |
|
|
@ -198,13 +198,13 @@ void test_addition_output_numberwithsignexponentprecision(void) |
|
|
|
unsigned int s0, s1, s2, s3, s4, e0, e1, e2, e3, e4, p0, p1, p2, p3, p4; |
|
|
|
|
|
|
|
s0 = sign(number[0].integer), s1 = sign(number[1].integer), s2 = sign(number[2].integer), s3 = sign(number[3].integer), s4 = sign(number[4].integer); |
|
|
|
e0 = e(number[0].integer), e1 = e(number[1].integer), e2 = e(number[2].integer), e3 = e(number[3].integer), e4 = e(number[4].integer); |
|
|
|
e0 = exponent(number[0].integer), e1 = exponent(number[1].integer), e2 = exponent(number[2].integer), e3 = exponent(number[3].integer), e4 = exponent(number[4].integer); |
|
|
|
p0 = precision(number[0].integer), p1 = precision(number[1].integer), p2 = precision(number[2].integer), p3 = precision(number[3].integer), p4 = precision(number[4].integer); |
|
|
|
result[0] = o(s0, e0, p0); |
|
|
|
result[1] = o(s1, e1, p1); |
|
|
|
result[2] = o(s2, e2, p2); |
|
|
|
result[3] = o(s3, e3, p3); |
|
|
|
result[4] = o(s4, e4, p4); |
|
|
|
result[0] = output(s0, e0, p0); |
|
|
|
result[1] = output(s1, e1, p1); |
|
|
|
result[2] = output(s2, e2, p2); |
|
|
|
result[3] = output(s3, e3, p3); |
|
|
|
result[4] = output(s4, e4, p4); |
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[0], result[0]); |
|
|
|
TEST_ASSERT_EQUAL_UINT(expected[1], result[1]); |
|
|
|