Skip to content

Instantly share code, notes, and snippets.

@gvitalie
Created November 23, 2025 13:49
Show Gist options
  • Select an option

  • Save gvitalie/f64bf896e41418986e7a8ef1f5408fe4 to your computer and use it in GitHub Desktop.

Select an option

Save gvitalie/f64bf896e41418986e7a8ef1f5408fe4 to your computer and use it in GitHub Desktop.
π using e^x
me@amadeus:~$ python3 -q
>>> import math
>>>
>>> def exp(x):
... a = 1
... for i in range(1, 30):
... a += (x ** i) / math.factorial(i)
... return a
...
>>> x = 3
>>> for i in range(3):
... x += exp(x * 1j).imag
...
>>> x
3.141592653589793
>>>
me@amadeus:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment