Сделал 1 Задание со списками
This commit is contained in:
parent
5dbf4901b8
commit
632a718df1
71 changed files with 106 additions and 0 deletions
|
@ -1,20 +0,0 @@
|
|||
#include "solve_polynomial.h"
|
||||
|
||||
int solvePolynomial(FILE * file, double x, double * derivative, double * polynomial) {
|
||||
double current, i;
|
||||
|
||||
if (fscanf(file, "%lf", ¤t) != 1) {
|
||||
printf("File is empty!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
*derivative = *polynomial = i = 0.;
|
||||
|
||||
do {
|
||||
*polynomial += current * pow(x, i);
|
||||
*derivative += i * current * pow(x, i - 1);
|
||||
i++;
|
||||
} while (fscanf(file, "%lf", ¤t) == 1);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue