meow
This commit is contained in:
parent
8a9418f513
commit
f7a282108c
3 changed files with 50 additions and 0 deletions
BIN
Lezione1/es1/es1
Executable file
BIN
Lezione1/es1/es1
Executable file
Binary file not shown.
49
Lezione1/es1/es1.c
Normal file
49
Lezione1/es1/es1.c
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
// gcc es1.c -Wall -pedantic -std=c17 -lm -o es1
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
float fattoriale(int n) {
|
||||
int kappa = 1;
|
||||
for(int i = 1; i <= n; i++) {
|
||||
kappa = i * kappa;
|
||||
}
|
||||
return kappa;
|
||||
}
|
||||
|
||||
// N
|
||||
// g_N(x) = SUM ( X^n / n! )
|
||||
// n=0
|
||||
double Gx(int N, double x) {
|
||||
|
||||
double r = 0.0;
|
||||
|
||||
for(int i = 0; i < N; i++) {
|
||||
r = r + (pow(x, N) / fattoriale(N));
|
||||
}
|
||||
|
||||
// printf("%f", tmp);
|
||||
return r;
|
||||
}
|
||||
|
||||
// F(x) = e^(x)
|
||||
double Fx(int x) {
|
||||
return exp(x);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
|
||||
//printf("La costante di Nepero e: %f\n", M_E);
|
||||
printf("e elevato alla seconda: %f\n", exp(1)); // e^2
|
||||
int MEOW = 50; // no idea del perché non funga
|
||||
puts("Start Program!!\n");
|
||||
|
||||
int vechi[50] = {0};
|
||||
|
||||
for(int i = 0; i < MEOW; i++) {
|
||||
}
|
||||
|
||||
printf("%lf\n", Gx(10, 7));
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
1
Lezione1/es1/newplot.md
Normal file
1
Lezione1/es1/newplot.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
# tutorial GNUPLOT
|
||||
Loading…
Add table
Add a link
Reference in a new issue