[New-bugs-announce] [issue36415] [math] Implement pow2 function

Марат Нагаев report at bugs.python.org
Sun Mar 24 07:33:10 EDT 2019


New submission from Марат Нагаев <sidorovmarat1995 at gmail.com>:

Hello.
I want to implement pow2 function special for powers of 2.
pow2 works 110 times faster if we pow 4 to 10**6
pow2 implementaion on Python:
def pow2(a,b):
p=log2(a)*b
if not p.isinteger():
raise TypeError('a isn't power of 2!')
return 1«p

----------
components: Library (Lib)
messages: 338728
nosy: nagayev
priority: normal
severity: normal
status: open
title: [math] Implement pow2 function
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36415>
_______________________________________


More information about the New-bugs-announce mailing list