diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..9c49f9774ed7be716c4e939d79dfb3fe92755b3f --- /dev/null +++ b/src/Makefile @@ -0,0 +1,13 @@ +all: question_3 + +question_3: question_3.o algo_ex1.o + g++ -o question_3 question_3.o algo_ex1.o + +algo_ex1.o: algo_ex1.h + g++ -Wall -Wextra -lgmpxx -lgmp algo_ex1.cpp -o algo_ex1.o + +question_3.o: question_3.cpp algo_ex1.h + g++ -Wall -Wextra -lgmpxx -lgmp question_3.cpp -o question_3.o + +clean: + rm -rf *.o diff --git a/src/algo_ex1.h b/src/algo_ex1.h index a9a13a6d7fb86d02c9827981ccbd31e4cc05576c..5509736ec5866ee70223905e84cc5123d0ce860e 100644 --- a/src/algo_ex1.h +++ b/src/algo_ex1.h @@ -1,4 +1,4 @@ #include <ctime> #include <gmpxx.h> -time_t sqrt(mpz_class const& a, mpz_class & res); +time_t algo_sqrt(mpz_class const& a, mpz_class & res); diff --git a/src/question_3.cpp b/src/question_3.cpp index 615e5e8f52e142286a71f5be4458fb966d60201e..7f1c5a7bb484fe3443af95f23aa1ede724fc5cd8 100644 --- a/src/question_3.cpp +++ b/src/question_3.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) { mpz_class res; time_t t; - t = sqrt(a, res); + t = algo_sqrt(a, res); std::cout << res << "\t" << t << std::endl; return 0;