Last active
January 17, 2017 01:09
-
-
Save gabrielcesar/3099bd1bfd3f857f7920e5efa9941646 to your computer and use it in GitHub Desktop.
Aula de Cálculo I. Prof.º Augusto. BSI2016. 16/01/2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
double func ( double x ); | |
double der ( double x ); | |
int main ( void ) | |
{ | |
double x = 3.0; | |
printf ( "Sua derivada no ponto %f é %.10f\n", x, der ( x )); | |
return 0; | |
} | |
double func ( double x ) | |
{ | |
double f; | |
f = x * x; | |
return f; | |
} | |
double der ( double x ) | |
{ | |
double d, h = 1e-03; //0.01 | |
d = ( func ( x + h ) - func ( x )) / h; | |
return d; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment