Click here to Skip to main content
16,007,443 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,,
am working on visual studio 2008 on console application
and am having a trouble solving this problem:

e=x+x^2/2!+x^3/3!+...

plzz any help i'd appreciate it
Posted

What is you trouble about?
You know, Visual Basic provide iterations.
 
Share this answer
 
Hi,

first of all your formula is wrong, the right hand side is the infinite polynomial that yields exp(x) or e^x, not e.

now what is your problem? the right hand side is the sum of terms, each term can easily be calculated once the value of the previous one is known. Two suggestions:
- use doubles
- make sure to continue the series long enough, i.e. till the newest term is only a fraction (say 1/10^15) of the partial sum so far.

A simple loop is all it takes!

:)
 
Share this answer
 
One word: Recursion.

The rest can be found in your text book.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900