Cody

Solution 1089665

Submitted on 25 Dec 2016 by Peng Liu
  • Size: 15
  • 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
n = 1; y_ok = 1.12; assert(abs(compound(n)-y_ok)<1e-9);

2   Pass
n = 2; y_ok = 1.1236; assert(abs(compound(n)-y_ok)<1e-9);

3   Pass
n = 12; y_ok = 1.126825030132; assert(abs(compound(n)-y_ok)<1e-9);

4   Pass
n = 52; y_ok = 1.127340987167; assert(abs(compound(n)-y_ok)<1e-9);

5   Pass
n = 365; y_ok = 1.127474615638; assert(abs(compound(n)-y_ok)<1e-9);

6   Pass
n = 31536000; y_ok = 1.1274968514306000; assert(abs(compound(n)-y_ok)<1e-9);