fix atoi_supescript

This commit is contained in:
hugogogo
2026-05-15 02:30:13 +02:00
parent f25291f12f
commit 0603050d30
3 changed files with 171 additions and 171 deletions

View File

@@ -108,7 +108,7 @@ run: $(NAME)
test: $(NAME) test: $(NAME)
@echo $(B_PURPLE)"\n---------------------------------------------\nlaunch tests\n"$(RESET) @echo $(B_PURPLE)"\n---------------------------------------------\nlaunch tests\n"$(RESET)
-@bash tester.sh -d -@bash tester.sh
clean: clean:
$(RM_OBJS) $(RM_OBJS)

2
libft

Submodule libft updated: e95f55c07f...71806cb923

338
tester.sh
View File

@@ -201,189 +201,189 @@ run_test \
Reduced form: 0 * x^0 - 6 * x^1 + 3 * x^2 = 0 Reduced form: 0 * x^0 - 6 * x^1 + 3 * x^2 = 0
Polynomial degree: 2 Polynomial degree: 2
Discriminant is strictly positive, the two solutions are: Discriminant is strictly positive, the two solutions are:
2
0"
run_test \
"10. degree 2" \
"3 * x^2 + 2 * x - 7 * x^1 = x" "\
Reduced form: 0 * x^0 - 6 * x^1 + 3 * x^2 = 0
Polynomial degree: 2
Discriminant is strictly positive, the two solutions are:
2
0"
run_test \
"11. degree 2" \
"-3x² + 2x -7 = x" "\
Reduced form: -7 * x^0 + 1 * x^1 - 3 * x^2 = 0
Polynomial degree: 2
Discriminant is strictly negative, the two complex solutions are:
0.166667 - 1.51841*i
0.166667 + 1.51841*i"
run_test \
"12. degree 2" \
"+3x² + 2x -7 = x" "\
Reduced form: -7 * x^0 + 1 * x^1 + 3 * x^2 = 0
Polynomial degree: 2
Discriminant is strictly positive, the two solutions are:
1.36992
-1.70326"
run_test \
"13. degree 2" \
"3x² + 0x -7 = x" "\
Reduced form: -7 * x^0 - 1 * x^1 + 3 * x^2 = 0
Polynomial degree: 2
Discriminant is strictly positive, the two solutions are:
1.70326
-1.36992"
run_test \
"14. degree 2" \
"3x² + 0x -0 = x" "\
Reduced form: 0 * x^0 - 1 * x^1 + 3 * x^2 = 0
Polynomial degree: 2
Discriminant is strictly positive, the two solutions are:
0.333333
0"
run_test \
"15. degree 2" \
"3x² + 2x -0 = x" "\
Reduced form: 0 * x^0 + 1 * x^1 + 3 * x^2 = 0
Polynomial degree: 2
Discriminant is strictly positive, the two solutions are:
0 0
2" -0.333333"
# run_test \ run_test \
# "10. degree 2" \ "16. degree 1" \
# "3 * x^2 + 2 * x - 7 * x^1 = x" "\ "3x + 2x -0 = x" "\
# Reduced form: 0 * x^0 - 6 * x^1 + 3 * x^2 = 0 Reduced form: 0 * x^0 + 4 * x^1 = 0
# Polynomial degree: 2 Polynomial degree: 1
# Discriminant is strictly positive, the two solutions are: The solution is:
# 2 0"
# 0"
# run_test \ run_test \
# "11. degree 2" \ "17. degree 2" \
# "-3x² + 2x -7 = x" "\ "3x² + x -0 = x" "\
# Reduced form: -7 * x^0 + 1 * x^1 - 3 * x^2 = 0 Reduced form: 0 * x^0 + 0 * x^1 + 3 * x^2 = 0
# Polynomial degree: 2 Polynomial degree: 2
# Discriminant is strictly negative, the two complex solutions are: Radicant is equal to zero, the solution is:
# 0.166667 - 1.51841*i 0"
# 0.166667 + 1.51841*i"
# run_test \ run_test \
# "12. degree 2" \ "18. degree 2" \
# "+3x² + 2x -7 = x" "\ "0x² + x -0 = x" "\
# Reduced form: -7 * x^0 + 1 * x^1 + 3 * x^2 = 0 Reduced form: 0 * x^0 = 0
# Polynomial degree: 2 Any real number is a solution."
# Discriminant is strictly positive, the two solutions are:
# 1.36992
# -1.70326"
# run_test \ run_test \
# "13. degree 2" \ "19. degree 5" \
# "3x² + 0x -7 = x" "\ "2x⁵ + x -0 = -7x^5" "\
# Reduced form: -7 * x^0 - 1 * x^1 + 3 * x^2 = 0 Reduced form: 0 * x^0 + 1 * x^1 + 0 * x^2 + 0 * x^3 + 0 * x^4 + 9 * x^5 = 0
# Polynomial degree: 2 Polynomial degree: 5
# Discriminant is strictly positive, the two solutions are: The polynomial degree is strictly greater than 2, I can't solve."
# 1.70326
# -1.36992"
# run_test \ run_test \
# "14. degree 2" \ "20. degree 1" \
# "3x² + 0x -0 = x" "\ "2x + x -0 = -7x" "\
# Reduced form: 0 * x^0 - 1 * x^1 + 3 * x^2 = 0 Reduced form: 0 * x^0 + 10 * x^1 = 0
# Polynomial degree: 2 Polynomial degree: 1
# Discriminant is strictly positive, the two solutions are: The solution is:
# 0.333333 0"
# 0"
# run_test \ run_test \
# "15. degree 2" \ "21. degree 1" \
# "3x² + 2x -0 = x" "\ "2x + x -3 = -7x" "\
# Reduced form: 0 * x^0 + 1 * x^1 + 3 * x^2 = 0 Reduced form: -3 * x^0 + 10 * x^1 = 0
# Polynomial degree: 2 Polynomial degree: 1
# Discriminant is strictly positive, the two solutions are: The solution is:
# 0 0.3"
# -0.333333"
# run_test \ run_test \
# "16. degree 1" \ "22. degree 1" \
# "3x + 2x -0 = x" "\ "-2x + x -3 = -7x" "\
# Reduced form: 0 * x^0 + 4 * x^1 = 0 Reduced form: -3 * x^0 + 6 * x^1 = 0
# Polynomial degree: 1 Polynomial degree: 1
# The solution is: The solution is:
# 0" 0.5"
# run_test \ run_test \
# "17. degree 2" \ "23. degree 2 without [=]" \
# "3x² + x -0 = x" "\ "3x^2" \
# Reduced form: 0 * x^0 + 0 * x^1 + 3 * x^2 = 0 "" \
# Polynomial degree: 2 error
# Radicant is equal to zero, the solution is:
# 0"
# run_test \ run_test \
# "18. degree 2" \ "24. degree 2" \
# "0x² + x -0 = x" "\ "3x^2 = 0" "\
# Reduced form: 0 * x^0 = 0 Reduced form: 0 * x^0 + 0 * x^1 + 3 * x^2 = 0
# Any real number is a solution." Polynomial degree: 2
Radicant is equal to zero, the solution is:
0"
# run_test \ run_test \
# "19. degree 5" \ "25. degree 2" \
# "2x⁵ + x -0 = -7x^5" "\ "3x^2 + 2 = 0" "\
# Reduced form: 0 * x^0 + 1 * x^1 + 0 * x^2 + 0 * x^3 + 0 * x^4 + 9 * x^5 = 0 Reduced form: 2 * x^0 + 0 * x^1 + 3 * x^2 = 0
# Polynomial degree: 5 Polynomial degree: 2
# The polynomial degree is strictly greater than 2, I can't solve." Radicant is strictly negative, the two complex solutions are:
i√(2/3)
-i√(2/3)"
# run_test \ run_test \
# "20. degree 1" \ "26. degree 2 pure" \
# "2x + x -0 = -7x" "\ "3 * x^2 + 5 * x^1 - 2 * x^0 = 5 * x" "\
# Reduced form: 0 * x^0 + 10 * x^1 = 0 Reduced form: -2 * x^0 + 0 * x^1 + 3 * x^2 = 0
# Polynomial degree: 1 Polynomial degree: 2
# The solution is: Radicant is strictly positive, the two solutions are:
# 0" √(2/3)
-√(2/3)"
# run_test \ run_test \
# "21. degree 1" \ "27. degree 2 pure" \
# "2x + x -3 = -7x" "\ "9 * x^2 + 5 * x^1 - 2 * x^0 = 5 * x" "\
# Reduced form: -3 * x^0 + 10 * x^1 = 0 Reduced form: -2 * x^0 + 0 * x^1 + 9 * x^2 = 0
# Polynomial degree: 1 Polynomial degree: 2
# The solution is: Radicant is strictly positive, the two solutions are:
# 0.3" √(2)/3
-√(2)/3"
# run_test \ run_test \
# "22. degree 1" \ "28. degree 2 pure" \
# "-2x + x -3 = -7x" "\ "3 * x^2 + 5 * x^1 - 4 * x^0 = 5 * x" "\
# Reduced form: -3 * x^0 + 6 * x^1 = 0 Reduced form: -4 * x^0 + 0 * x^1 + 3 * x^2 = 0
# Polynomial degree: 1 Polynomial degree: 2
# The solution is: Radicant is strictly positive, the two solutions are:
# 0.5" 2/√(3)
-2/√(3)"
# run_test \ run_test \
# "23. degree 2 without [=]" \ "29. degree 2 pure" \
# "3x^2" \ "16 * x^2 + 5 * x^1 - 4 * x^0 = 5 * x" "\
# "" \ Reduced form: -4 * x^0 + 0 * x^1 + 16 * x^2 = 0
# error Polynomial degree: 2
Radicant is strictly positive, the two solutions are:
1/2
-1/2"
# run_test \ run_test \
# "24. degree 2" \ "30. degree 2 pure" \
# "3x^2 = 0" "\ "4 * x^2 + 5 * x^1 - 16 * x^0 = 5 * x" "\
# Reduced form: 0 * x^0 + 0 * x^1 + 3 * x^2 = 0 Reduced form: -16 * x^0 + 0 * x^1 + 4 * x^2 = 0
# Polynomial degree: 2 Polynomial degree: 2
# Radicant is equal to zero, the solution is: Radicant is strictly positive, the two solutions are:
# 0" 2
-2"
# run_test \ run_test \
# "25. degree 2" \ "31. degree 2" \
# "3x^2 + 2 = 0" "\ "3x² + 2x -7 = x" "\
# Reduced form: 2 * x^0 + 0 * x^1 + 3 * x^2 = 0 Reduced form: -7 * x^0 + 1 * x^1 + 3 * x^2 = 0
# Polynomial degree: 2 Polynomial degree: 2
# Radicant is strictly negative, the two complex solutions are: Discriminant is strictly positive, the two solutions are:
# i√(2/3) 1.36992
# -i√(2/3)" -1.70326"
# run_test \
# "26. degree 2 pure" \
# "3 * x^2 + 5 * x^1 - 2 * x^0 = 5 * x" "\
# Reduced form: -2 * x^0 + 0 * x^1 + 3 * x^2 = 0
# Polynomial degree: 2
# Radicant is strictly positive, the two solutions are:
# √(2/3)
# -√(2/3)"
# run_test \
# "27. degree 2 pure" \
# "9 * x^2 + 5 * x^1 - 2 * x^0 = 5 * x" "\
# Reduced form: -2 * x^0 + 0 * x^1 + 9 * x^2 = 0
# Polynomial degree: 2
# Radicant is strictly positive, the two solutions are:
# √(2)/3
# -√(2)/3"
# run_test \
# "28. degree 2 pure" \
# "3 * x^2 + 5 * x^1 - 4 * x^0 = 5 * x" "\
# Reduced form: -4 * x^0 + 0 * x^1 + 3 * x^2 = 0
# Polynomial degree: 2
# Radicant is strictly positive, the two solutions are:
# 2/√(3)
# -2/√(3)"
# run_test \
# "29. degree 2 pure" \
# "16 * x^2 + 5 * x^1 - 4 * x^0 = 5 * x" "\
# Reduced form: -4 * x^0 + 0 * x^1 + 16 * x^2 = 0
# Polynomial degree: 2
# Radicant is strictly positive, the two solutions are:
# 1/2
# -1/2"
# run_test \
# "30. degree 2 pure" \
# "4 * x^2 + 5 * x^1 - 16 * x^0 = 5 * x" "\
# Reduced form: -16 * x^0 + 0 * x^1 + 4 * x^2 = 0
# Polynomial degree: 2
# Radicant is strictly positive, the two solutions are:
# 2
# -2"
# run_test \
# "31. degree 2" \
# "3x² + 2x -7 = x" "\
# Reduced form: -7 * x^0 + 1 * x^1 + 3 * x^2 = 0
# Polynomial degree: 2
# Discriminant is strictly positive, the two solutions are:
# 1.36992
# -1.70326"