Cody

Solution 1605697

Submitted on 10 Aug 2018 by goc3
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))

ans = int8 -1 c = int8 -1

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

ans = 3 c = 3

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

ans = 0 c = 0

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

ans = int16 -100 c = int16 -100

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

ans = single 300 c = single 300