-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsinTaylor.c
More file actions
49 lines (42 loc) · 1.15 KB
/
sinTaylor.c
File metadata and controls
49 lines (42 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/************************************************************
* *
* Exemplo de utilização de FPU *
* e integração C e assembly *
* Autor: Gabriel Matheus *
* github.com/gmsj *
* *
************************************************************/
// Parte complementar em C
#include <stdio.h>
#include <stdlib.h>
float obterAngulo () {
float angulo;
printf("Digite o angulo:\n");
scanf("%f", &angulo);
return angulo;
}
float obterDif () {
float diferenca;
printf("Digite a diferenca:\n");
scanf("%f", &diferenca);
return diferenca;
}
void imprimir (float seno, float interacoes) {
printf("Valor do seno [%f] - Num de interacoes [%.0f]\n", seno, interacoes);
}
float fatorial (float num) {
if (num > 1)
num *= fatorial(num-1);
return num;
}
float pot (float num, float exp) {
int i;
float result = 1;
if (exp == 0) {
return 1;
}
for (i = 0; i < exp; i++) {
result = result * num;
}
return result;
}