Cody

Problem 2168. Positive Infinity

Solution 1763287

Submitted on 27 Mar 2019 by Abdelfatah Teamah
• Size: 7
• This is the leading solution.
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 = [2.5 -1.7 5.6 8.4] y_correct = [ 3 -1 6 9]; assert(isequal(positiveround(a),y_correct)) a = [ -105.25 78.89 -0.1 0.9 7.2] y_correct = [ -105 79 0 1 8] assert(isequal(positiveround(a),y_correct)) a = [ 265.25 88.99 -0.1 0.9 7.2] y_correct = [ 266 89 0 1 8] assert(isequal(positiveround(a),y_correct))

a = 2.5000 -1.7000 5.6000 8.4000 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In positiveround (line 2) In ScoringEngineTestPoint1 (line 3) In solutionTest (line 3)] a = -105.2500 78.8900 -0.1000 0.9000 7.2000 y_correct = -105 79 0 1 8 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In positiveround (line 2) In ScoringEngineTestPoint1 (line 7) In solutionTest (line 3)] a = 265.2500 88.9900 -0.1000 0.9000 7.2000 y_correct = 266 89 0 1 8 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In positiveround (line 2) In ScoringEngineTestPoint1 (line 11) In solutionTest (line 3)]