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
Asked
Active
Viewed 222 times
3 Answers
0
Just press ctrl+c
to exit out of the interpreter!

Secret
- 3,291
- 3
- 32
- 50
-
Did not work for me. I mean, its completely freeze. I can use every other program but I can't use Python or shut it down. – Federico Collasius Feb 28 '15 at 14:34
-
Try `cmd+Q`, which will quit the program. If the laptop is completely frozen though... – Secret Feb 28 '15 at 14:36
-
No, the laptop isn't frozen, the program is. I'm talking to you through the laptops Chrome. And no, it did not work what you told me. – Federico Collasius Feb 28 '15 at 14:40
-
@FedericoCollasius You can try force quitting it (Command-Option-Escape) and then killing the program. – Secret Feb 28 '15 at 14:42
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
-
Thank you very much. I already fix the problem but I will take your advice. – Federico Collasius Feb 28 '15 at 14:46
-
Python can deal with large numbers without Sympy. Sympy if for *symbolic* computation (ex sqrt(8) = 2 * sqrt(2)), not for large numbers operations. – Serge Ballesta Feb 28 '15 at 14:46
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