... Math
This commit is contained in:
parent
974ccc9f27
commit
5e6545aae8
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
bash clean.sh
|
||||
clang-6.0 -c func1.c main.c -lm
|
||||
clang-6.0 -s func1.o main.o
|
||||
|
@ -4,8 +4,7 @@
|
||||
#define func1
|
||||
|
||||
int func3(int x) {
|
||||
//return pow(x, 3) - 3 * pow(x, 2) - x + 3;
|
||||
return x + 10;
|
||||
return pow(x, 3) - 3 * pow(x, 2) - x + 3;
|
||||
}
|
||||
|
||||
int func2(int x) {
|
||||
@ -25,4 +24,4 @@ int recurse2(int count) {
|
||||
printf("Recurse 2: %d\n", func3(count - 1));
|
||||
return recurse1(count - 1);
|
||||
}else return 0;
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@ int main(int argc, char **argv) {
|
||||
printf("Funktion 1: %d\n" ,func3(2));
|
||||
printf("Funktion 2: %d\n" , func2(2));
|
||||
|
||||
|
||||
|
||||
int tmp = 0;
|
||||
for(int i = 0; i <= 5; ++i) {
|
||||
tmp += func3(i);
|
||||
|
Loading…
Reference in New Issue
Block a user