rename executable computor
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
computorv1
|
||||
computor
|
||||
|
||||
# ---> C
|
||||
# Prerequisites
|
||||
|
||||
56
.vscode/launch.json
vendored
Normal file
56
.vscode/launch.json
vendored
Normal file
File diff suppressed because one or more lines are too long
6
Makefile
6
Makefile
@@ -31,7 +31,7 @@ RESET = "\e[0m"
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
|
||||
# FILES :
|
||||
NAME = computorv1
|
||||
NAME = computor
|
||||
D_LIB = ./libft
|
||||
D_HEADERS = ./headers
|
||||
HEADERS = computorv1.h
|
||||
@@ -145,6 +145,10 @@ run: $(NAME)
|
||||
-./$(NAME) $(RUN_FLAGS) "2x + x -0 = -7x"
|
||||
@echo $(B_PURPLE)"\n---------------------------------------------\n21. degree 1 \n"$(RESET)
|
||||
-./$(NAME) $(RUN_FLAGS) "2x + x -3 = -7x"
|
||||
@echo $(B_PURPLE)"\n---------------------------------------------\n23. degree 2 SHOULD FAIL \n"$(RESET)
|
||||
-./$(NAME) $(RUN_FLAGS) "3x^2"
|
||||
@echo $(B_PURPLE)"\n---------------------------------------------\n23. degree 2 \n"$(RESET)
|
||||
-./$(NAME) $(RUN_FLAGS) "3x^2 = 0"
|
||||
clean:
|
||||
$(RM_OBJS)
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# 42_EXT_05_computorv1
|
||||
|
||||
## todo
|
||||
|
||||
- change "compputorv1" to "computor"
|
||||
- doing gcd for int values, and not for double values
|
||||
- double is nearly_equal_0
|
||||
|
||||
|
||||
## ressources
|
||||
|
||||
@@ -69,7 +75,6 @@ this project uses submodules (maybe recursively), so either :
|
||||
- delta_sqrt; // √|Δ|
|
||||
- first_term; // double (-b / 2a)
|
||||
- second_term; // double (√|Δ| / 2a)
|
||||
|
||||
- double solution1; // first_term + second_term || -b / 2a + √|Δ| * i / 2a
|
||||
- double solution2; // first_term - second_term || -b / 2a - √|Δ| * i / 2a
|
||||
6. print solution
|
||||
|
||||
@@ -191,8 +191,8 @@ void print_solution(s_solution *solution)
|
||||
else if (solution_d2.delta_sign < 0)
|
||||
{
|
||||
ft_printf("Discriminant is strictly negative, the two complex solutions are:\n");
|
||||
printf("%g/%g + %gi/%g\n", solution_d2.b * -1, solution_d2.a * 2, solution_d2.delta_absolute, solution_d2.a * 2);
|
||||
printf("%g/%g - %gi/%g\n", solution_d2.b * -1, solution_d2.a * 2, solution_d2.delta_absolute, solution_d2.a * 2);
|
||||
printf("%g/%g + %gi/%g\n", solution_d2.b * -1, solution_d2.a * 2, solution_d2.delta_sqrt, solution_d2.a * 2);
|
||||
printf("%g/%g - %gi/%g\n", solution_d2.b * -1, solution_d2.a * 2, solution_d2.delta_sqrt, solution_d2.a * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user