Question: C code: Its three problems but they all build on each other 1 Approximating The value of can be approximated using the Nilakantha series ~3+
1 Approximating The value of can be approximated using the Nilakantha series ~3+ 2.3-4-4-5-6+6-7-8-8-9-10+10-11-12- 12-13-14 + write a C function that calculates the value of with a variable level of accuracy. For instance, if the desired accuracy is 10-6. the absolute difference between the true value of (see below) and the approximation from your function is less than 10-6. Use the function prototype double Pi value(int numaccuracy ASSERT your fuction by running unit tests (see sec 5.7 in your Zybook) for values 1, 2, 3, 4, 5. 6 Examples of test ing your function are const double pi = 3.1415926535897932384 62643383; assert (fabs (Pi.value (2) pi) pou(10.0, -2)) assert (f abs (Pi.value (6) i)pow(10.0, -6)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
