Cody

Solution 1576778

Submitted on 6 Jul 2018 by David Verrelli
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 = int8(1); b = int8(2); c = intOrfloat(a, b) assert(isequal(c,-1))

c = int8 -1

2   Pass
a = 1; b = 2; c = intOrfloat(a, b) assert(isequal(c,3))

c = 3

3   Pass
a = uint8(1); b = uint8(2); c = intOrfloat(a, b) assert(isequal(c,0))

c = uint8 0

4   Pass
a = int16(100); b = int16(200); c = intOrfloat(a, b) assert(isequal(c,-100))

c = int16 -100

5   Pass
a = single(100); b = single(200); c = intOrfloat(a, b) assert(isequal(c,300))

c = single 300

Suggested Problems

More from this Author16