diff --git a/Lezione1/es1/es1 b/Lezione1/es1/es1 new file mode 100755 index 0000000..533003c Binary files /dev/null and b/Lezione1/es1/es1 differ diff --git a/Lezione1/es1/es1.c b/Lezione1/es1/es1.c new file mode 100644 index 0000000..c4f1db4 --- /dev/null +++ b/Lezione1/es1/es1.c @@ -0,0 +1,49 @@ +// gcc es1.c -Wall -pedantic -std=c17 -lm -o es1 +#include +#include +#include + +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; +} \ No newline at end of file diff --git a/Lezione1/es1/newplot.md b/Lezione1/es1/newplot.md new file mode 100644 index 0000000..6d55d75 --- /dev/null +++ b/Lezione1/es1/newplot.md @@ -0,0 +1 @@ +# tutorial GNUPLOT