# Taylor series regarding E^x

• 05-04-2010
rafacnsoccer
Taylor series regarding E^x
okay my main problem right now is trying to convert this:
exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + x^4/4! + ....

into programming language. the part that seems to confuse me is the factorial part.
the problem is that i am really confused and dnt know how to start
• 05-04-2010
tabstop
Factorial is not built into C++. You'll have to write it yourself.
• 05-04-2010
NeonBlack
Did you search "How to calculate factorial in c++"? Were you simply overwhelmed by the sheer number of pages that tell you exactly how to do it?
• 05-04-2010
rafacnsoccer
yea i understand that i am not sure how to tho. the top part i can but not sure about the n! part
• 05-04-2010
rafacnsoccer
yea im searching now but sometimes i do not really understand some of the things they put up.
• 05-04-2010
NeonBlack
Well if you don't understand something, feel free to ask a question.
• 05-05-2010
Veneficvs
The factorial function goes like this:
Code:

```int f(int x) {     if(x == 1)     return 1;     else     return x * f(x - 1); }```
• 05-05-2010
Brafil
Actually you shouldn't post the code here, it's his job to figure out.
• 05-05-2010
StainedBlue
Yea dont let em circumvent the jfgi and stfw