Problem 43154. Basics - not so easy division

Solution 1731091

Submitted on 20 Feb 2019 by James Campbell
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
x = 1; y=1; z_correct = 1; assert(isequal(dividing(x,y),z_correct))

2   Pass
x = 1; y=0; z_correct = 'ERROR'; assert(isequal(dividing(x,y),z_correct))

3   Pass
x = Inf; y=-Inf; z_correct = 'ERROR'; assert(isequal(dividing(x,y),z_correct))

4   Pass
x = 1; y=NaN; z_correct = 'ERROR'; assert(isequal(dividing(x,y),z_correct))

Suggested Problems

More from this Author12

Community Treasure Hunt

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

Start Hunting!