Cody

Problem 1789. Adding and Subtracting UINT variables

Solution 2830404

Submitted on 13 Aug 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
A=uint32(5); B=uint32(6); C=uint32(4); s_exp=3; s=uint_function(A,B,C); assert(isequal(s,s_exp),sprintf('s = %3i',s))

s = 4

2   Pass
A=uint32(7); B=uint32(6); C=uint32(12); s_exp=13; s=uint_function(A,B,C); assert(isequal(s,s_exp),sprintf('s = %3i',s))

3   Fail
A=uint16(1); B=uint16(6); C=uint16(5); s_exp=0; s=uint_function(A,B,C); assert(isequal(s,s_exp),sprintf('s = %3i',s))

s = 5

4   Fail
A=uint64(12); B=uint64(14); C=uint64(3); s_exp=1; s=uint_function(A,B,C); assert(isequal(s,s_exp),sprintf('s = %3i',s))

s = 3

5   Fail
A=uint8(4); B=uint8(8); C=uint8(4); s_exp=0; s=uint_function(A,B,C); assert(isequal(s,s_exp),sprintf('s = %3i',s))

s = 4