-4

I am working in a problemas involving the e number . So I found this webpage which has 1000000 digits of the e number and I copy pasted to Python IDL. In the instant I pasted it froze and its still like that. I don't how long would it be or if it will harm the computer (I'm working in a MacBook Pro which is not mine).Also I can't shut down the computer because the program is working. So can someone tell me what will happend and how long this may last and if there is a way to stop the program. Any help will be really appreciated. Thanks

Yuri Tsoglin
  • 963
  • 4
  • 7

3 Answers3

0

Just press ctrl+c to exit out of the interpreter!

Secret
  • 3,291
  • 3
  • 32
  • 50
0

If you're interested in many digits, Sympy might be useful. You can calculate e to a 1000000 digits with (needs a couple minutes to compute):

import sympy as sy

print(sy.E.evalf(n=1000000))
Dietrich
  • 5,241
  • 3
  • 24
  • 36
0

Python should accept numbers with 100 digits as input without problem. But to actually use numbers with so high precision, you should use the decimal module of Python Standard Library. Example :

import decimal
n = decimal.Decimal('1.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890')
n2 = n + n
print(n2)

=> Decimal('2.246913578024691357802469135780246913578024691357802469135780246913578024691357802469135780246913578')

Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252