Message259421
| Author |
skrah |
| Recipients |
jneb, mark.dickinson, serhiy.storchaka, skrah |
| Date |
2016年02月02日.19:10:40 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1454440240.68.0.839073260237.issue26256@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Jurjen, this is very nice! -- Like Mark, I'm not sure if this should be in CPython.
Decimal (Python >= 3.3) has sneaked in a couple of fast bignum
algorithms, so calculating and converting the latest Mersenne
prime takes a couple of seconds:
from decimal import *
c = getcontext()
c.prec = MAX_PREC
c.Emax = MAX_EMAX
c.Emin = MIN_EMIN
x = Decimal(2)**74207281 - 1
s = str(x)
assert s[:12] == "300376418084"
assert s[-12:] == "391086436351" |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年02月02日 19:10:40 | skrah | set | recipients:
+ skrah, jneb, mark.dickinson, serhiy.storchaka |
| 2016年02月02日 19:10:40 | skrah | set | messageid: <1454440240.68.0.839073260237.issue26256@psf.upfronthosting.co.za> |
| 2016年02月02日 19:10:40 | skrah | link | issue26256 messages |
| 2016年02月02日 19:10:40 | skrah | create |
|