-
-
Save yashppawar/afb75f5a06b335a3cbb1ef9abe63f459 to your computer and use it in GitHub Desktop.
finding the value of e (eulers number) using limits and approaching, in python.
This file contains 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 maths | |
# solving for the value of e using approaching. | |
def e(num: int) -> int: | |
return math.pow(1 + 1 / num, num) | |
for i in range(1, int(1e10), 1000): | |
# slowly aproaching towards the value of e | |
print(f"{i=} {e=}") | |
# using limits, lim{num -> inf} e(num) | |
print(f"e using a large number {e(1e11)}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment