On Wed, Jan 15, 2020 at 1:10 PM Александр Ватузов <amvatu...@gmail.com> wrote: > > As I undestand, sage uses custom int
no, Sage's int is the same as Python's int. But Sage has other integer types, e.g. ZZ. > > среда, 15 января 2020 г., 12:22:51 UTC+3 пользователь Dima Pasechnik написал: >> >> On Tue, Jan 14, 2020 at 10:23 PM Nils Bruin <nbr...@sfu.ca> wrote: >> > >> > 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. >> > >> it is a Sage-specfic bug, as simply installing mpmath into system >> Python3 fails to reproduce the issue. >> (or perhaps it's due to Cython, or a specific version of it) >> Does Sage use a "custom" divmod in mpmath code? >> >> >> >> > -- >> > 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-s...@googlegroups.com. >> > To view this discussion on the web visit >> > https://groups.google.com/d/msgid/sage-support/78a83c70-0f12-4df0-a2e4-d4a499b388bf%40googlegroups.com. > > -- > 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/596f9268-9a22-489a-9e18-fd049e9cee6c%40googlegroups.com. -- 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/CAAWYfq3_3U_v4tQfTw_h4WRVnHfTvAs9nG2UiUA7tirbTcjf5g%40mail.gmail.com.