Created
September 13, 2025 14:43
-
-
Save gvitalie/d555afbffe5d0d65e2524dfb4a785783 to your computer and use it in GitHub Desktop.
π
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| def sin(x): | |
| a = 0 | |
| for i in range(30): | |
| a += ((-1) ** i) * (x ** (2*i+1)) / math.factorial(2*i+1) | |
| return a | |
| a = 3 | |
| for i in range(3): | |
| a += sin(a) | |
| print(a, sin(a)) | |
| /home/me/Projects/AI/.venv/bin/python /home/me/Projects/AI/Bb.py | |
| 3.141120008059867 0.0004726455123287083 | |
| 3.1415926535721956 1.759734884346061e-11 | |
| 3.141592653589793 3.3280566969799443e-16 | |
| Process finished with exit code 0 |
Author
gvitalie
commented
Sep 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment