Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- double partA(const double& x, const size_t& N)
- {
- double summary = x;
- double numerator = 1, denominator = 1;
- double xScale = x;
- int scale = 2;
- for (size_t i = 1; i < N; i++)
- {
- xScale *= -x;
- numerator *= (scale - 1);
- denominator *= scale;
- const double temp = numerator / denominator * xScale;
- summary += temp;
- scale += 2;
- }
- return summary;
- }
- int main()
- {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement