Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Ramanujans-constant/Python/ramanujans-constant.py
Normal file
8
Task/Ramanujans-constant/Python/ramanujans-constant.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from mpmath import mp
|
||||
heegner = [19,43,67,163]
|
||||
mp.dps = 50
|
||||
x = mp.exp(mp.pi*mp.sqrt(163))
|
||||
print("calculated Ramanujan's constant: {}".format(x))
|
||||
print("Heegner numbers yielding 'almost' integers:")
|
||||
for i in heegner:
|
||||
print(" for {}: {} ~ {} error: {}".format(str(i),mp.exp(mp.pi*mp.sqrt(i)),round(mp.exp(mp.pi*mp.sqrt(i))),(mp.pi*mp.sqrt(i)) - round(mp.pi*mp.sqrt(i))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue