Cody

Problem 1274. Accurate Division

Solution 3435463

Submitted on 27 Oct 2020
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   Fail
x = 11; y = 7; d = 10; z_correct = '1.571428571'; assert(isequal(adiv(x,y,d),z_correct))

Undefined function 'vpa' for input arguments of type 'double'. Error in adiv (line 2) z = vpa(x/y,d); Error in Test1 (line 5) assert(isequal(adiv(x,y,d),z_correct))

2   Fail
x = 1120; y = 23; d = 60; z_correct = '48.6956521739130434782608695652173913043478260869565217391304'; assert(isequal(adiv(x,y,d),z_correct))

Undefined function 'vpa' for input arguments of type 'double'. Error in adiv (line 2) z = vpa(x/y,d); Error in Test2 (line 5) assert(isequal(adiv(x,y,d),z_correct))

3   Fail
x = 17; y = 8234; d = 75; z_correct = '0.00206461015302404663589992713140636385717755647316006801068739373330094729172'; assert(isequal(adiv(x,y,d),z_correct))

Undefined function 'vpa' for input arguments of type 'double'. Error in adiv (line 2) z = vpa(x/y,d); Error in Test3 (line 5) assert(isequal(adiv(x,y,d),z_correct))

4   Fail
x = 126; y = 2400; d = 10; z_correct = '0.0525'; assert(isequal(adiv(x,y,d),z_correct))

Undefined function 'vpa' for input arguments of type 'double'. Error in adiv (line 2) z = vpa(x/y,d); Error in Test4 (line 5) assert(isequal(adiv(x,y,d),z_correct))

Suggested Problems

More from this Author11

Community Treasure Hunt

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

Start Hunting!