Cody

Problem 42339. ~(*|/)

Solution 1597449

Submitted on 1 Aug 2018
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
n = 0; y_correct = 0; tolerance = 1e-12; assert(abs(no_mult_div(n)-y_correct)<tolerance);

y = 0

2   Fail
n = 0.1; y_correct = 0.0750; tolerance = 1e-12; assert(abs(no_mult_div(n)-y_correct)<tolerance);

y = 0.1333

Assertion failed.

3   Fail
n = 1; y_correct = 0.7500; tolerance = 1e-12; assert(abs(no_mult_div(n)-y_correct)<tolerance);

y = 1.3333

Assertion failed.

4   Fail
n = -1; y_correct = -0.7500; tolerance = 1e-12; assert(abs(no_mult_div(n)-y_correct)<tolerance);

y = -1.3333

Assertion failed.

Suggested Problems

More from this Author1

Community Treasure Hunt

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

Start Hunting!