"Correct" answer does not have enough precision.
You need more test cases, with different values of n. Otherwise it's trivial to defeat the test suite.
I agree with Sean
I agree with Sean and Guillaume. I had to use "y = round(y*10000)/10000;" to get my code to pass the test.
917 Solvers
525 Solvers
07 - Common functions and indexing 3
330 Solvers
Rounding off numbers to n decimals
1084 Solvers
Let's see how peculiar we can get
155 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!