Cody

Solution 1018824

Submitted on 16 Oct 2016 by jf86
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
a = int8(1); b = int8(2); c = intOrfloat(a, b) assert(isequal(c,-1)) a = 1; b = 2; c = intOrfloat(a, b) assert(isequal(c,3)) a = uint8(1); b = uint8(2); c = intOrfloat(a, b) assert(isequal(c,0)) a = int16(100); b = int16(200); c = intOrfloat(a, b) assert(isequal(c,-100)) a = single(100); b = single(200); c = intOrfloat(a, b) assert(isequal(c,300))

c = int8 -1 c = 3 c = uint8 0 c = int16 -100 c = single 300