[issue42779] pow() of huge input does not complete

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The computational complexity of algorithm used to convert integer to decimals 
is proportional to the cube of the size of the number. It is known issue. There 
are better algorithms (perhaps gmpy2 uses them), but they benefit only 
extremely large numbers, for which exact decimal form is not very useful.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] pow() of huge input does not complete

2020-12-29 Thread minipython


minipython <599192...@qq.com> added the comment:

oh.You are right.If i directly compute the huge result without 
printing,it only takes 115s.Thank you very much.I'm sorry to forget noting the 
print function.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] pow() of huge input does not complete

2020-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Are you sure that this is a time of calculating pow() and not the time of 
calculating decimal representation of the result?

On my computer:

>>> t = time(); a = pow(c, 2**14+1); time()-t
11.957276344299316
>>> t = time(); a = pow(c, 2**15+1); time()-t
36.08853316307068
>>> t = time(); a = pow(c, 2**16+1); time()-t
107.43462753295898

The computational complexity is O((log(c)*e)**1.5). And it needs not so much 
memory: around 20 MB for final result, and few times more for intermediate 
results, so this is not matter of swapping.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] pow() of huge input does not complete

2020-12-29 Thread minipython


minipython <599192...@qq.com> added the comment:

Here are my information.
1.python 3.8.6
2.windows 10(build 19042 20h2)
3. 16Gb memory
4. It doesn't complete.It takes about 30 minutes but it gives no output.
5. It takes 6.346898794174194s
6. It takes 0.3690004348754883s.

--
versions: +Python 3.8 -Python 3.6, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42779] pow() of huge input does not complete

2020-12-29 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
components: +Interpreter Core -C API
title: Pow compute can only available in python3.7 -> pow() of huge input does 
not complete
versions: +Python 3.6, Python 3.9 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com