about | help | code help+videos | done | prefs |
Write a method that returns the 'degree'th Maclauren approximation for e^x evaluated at 'x'. The Maclauren series for e^x is: 1+x+(1/2!)x^2+(1/3!)x^3+...+(1/n!)x . where n is the degree of the Maclauren series. For example, if degree=2 and x=1.2 you would calculate: 1+(1.2)+(1/2!)(1.2)^2 and return that result as a double. If degree=3 and x=2.5 you would calculate: 1+(2.5)+(1/2!)(2.5)^2+(1/3!)(2.5)^3 and return that result as a double. test2020_10_15_HL_maclauren(0, 3.2) → 1.0 test2020_10_15_HL_maclauren(1, 2.0) → 3.0 test2020_10_15_HL_maclauren(5, 1.0) → 2.7166666666666663 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 295
Copyright Nick Parlante 2017 - privacy