Last active
October 18, 2017 19:37
-
-
Save ivanursul/d98691bb4e2d28d0288273f4a06187fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int alpha = 3; | |
int x = 5; | |
int i = 1; | |
double iterResult; | |
double result = 1.0 | |
do { | |
numVal = 1; | |
for (int j = 0; j < i; j++) { | |
numVal *= (alpha - j); | |
} | |
int denomVal = fact(i); | |
iterResult = (numVal / (double) denomVal) * pow(x, i); | |
cout >> iterResult; | |
result += iterResult; | |
i++; | |
} while(iterResult != 0.0) | |
1 iter | |
numVal = 1 | |
i = 1 | |
numVal = numVal * (alpha - j); | |
numVal = 1 * (3 - 0) = 3 | |
2 iter | |
numVal = 1 | |
i = 2 | |
numVal = numVal * (alpha - j); | |
numval = 1 * (3 - 0) = 3 | |
numVal = 3 * (3 - 1) = 3 * | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment