Cody

Problem 1789. Adding and Subtracting UINT variables

Solution 2885960

Submitted on 28 Aug 2020 by Rafael S.T. Vieira
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   Pass
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))

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   Pass
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))

4   Pass
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))

5   Pass
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))

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!