yes, but it is function that translates numbers into strings, don't need 
such optimizations

среда, 15 января 2020 г., 1:23:36 UTC+3 пользователь Nils Bruin написал:
>
> On Tuesday, January 14, 2020 at 5:36:27 AM UTC-8, Александр Ватузов wrote:
>>
>> Now I constantly know, that problem was in using
>>
>> divmod(n, base**half)
>>
>> instead of
>>
>> n // (base**half), n % (base**half)
>>
>
> The second option yields a performance regression relative to the first, 
> because you would end up doing an integer division twice rather than one 
> (integer division yields both the quotient and the remainder, so throwing 
> one away and then recomputing it to find it anyway is wasteful). You're 
> also performing an exponentiation twice.
>
> I think it would be better to find/write a "divmod" that works in py3 as 
> well.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/e4ccf4b7-cf4e-447a-81df-ce7fee6fc3a4%40googlegroups.com.

Reply via email to