Марат Нагаев added the comment:
110 times is the result on MacBook 2017 13
In my phone this works 187 times faster!
--
___
Python tracker
<https://bugs.python.org/issue36
New submission from Марат Нагаев :
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!
Марат Нагаев added the comment:
ping @tim.peters
--
___
Python tracker
<https://bugs.python.org/issue36228>
___
___
Python-bugs-list mailing list
Unsubscribe:
Марат Нагаев added the comment:
Can I implement this methods?
@tim.peters
--
___
Python tracker
<https://bugs.python.org/issue36228>
___
___
Python-bugs-list m
Марат Нагаев added the comment:
I think at bank.
I find post (Russian) about complex numbers:
https://cyberleninka.ru/article/v/primenenie-kompleksnyh-chisel-v-finansovyh-operatsiyah
And rounding was used.
Sorry, I don't know about English version of this ar
Марат Нагаев added the comment:
>For those rare cases where this is needed, it isn't that hard to spell out
>`complex(floor(z.real)
But in Python we have math.tau. However it's just 2*pi.
>`math.floor` of a `float` object returns an `int`
Maybe the best solution is to add
Марат Нагаев added the comment:
Oh, __floor__ can return anything.
So I suggest:
1. Methods __floor__ and __ceil__ for complex object.
2. Don't change __float__ and __int__ methods.
3. So I think it isn't nessesary to add methods floor and ceil to complex
module.
Example:
from math
Марат Нагаев added the comment:
I think math.floor should raise TypeError if complex argument passed,
but we need cmath.floor(and ceil).
As I know floor complex number is just floor real part and floor imag.
Example:
z=1.1+2.5j
floor(z) #2+3j
I think it's correct.
But I don't know abo
Change by Марат Нагаев :
--
title: Add function to complex objectf -> Add function to complex object
___
Python tracker
<https://bugs.python.org/issu
New submission from Марат Нагаев :
I think complex object should have methods __float__ (returns real part) and
__int__ (returns int(real)).
Also I think we need floor and ceil methods om cmath module.
I think, these functions are useful.
--
components: Extension Modules, Library (Lib
New submission from Марат Нагаев :
Hey guys,
I find bug in Python.
If you'll try to file stream using open function you can edit file mode:
Watch git:
https://gist.github.com/nagayev/7d17ead7b3bc2b06f2445fb5d9122a5c
In fact,mode don't changed,so mode shoul be constant like a encod
Change by Марат Нагаев :
--
components: IO
nosy: nagayev
priority: normal
severity: normal
status: open
title: File mode shou
type: behavior
versions: Python 3.7
___
Python tracker
<https://bugs.python.org/issue32
Change by Марат Нагаев :
--
components: +Extension Modules
___
Python tracker
<https://bugs.python.org/issue31918>
___
___
Python-bugs-list mailing list
Unsub
New submission from Марат Нагаев :
import os
os="os"
#I think it's bad, os and other modules constants
--
title: D -> Don't let all python code modify modules
___
Python tracker
<https://
Change by Марат Нагаев :
--
nosy: Марат Нагаев
priority: normal
severity: normal
status: open
title: D
type: enhancement
___
Python tracker
<https://bugs.python.org/issue31
15 matches
Mail list logo