[sage-devel] Overflow error in `set_random_seed(1);a=(Integers(13)(2))**randint(2,2**4000-1)`

2023-08-12 Thread Georgi Guninski
``` set_random_seed(1);a=(Integers(13)(2))**randint(2,2**4000-1) OverflowError Traceback (most recent call last) OverflowError: Python int too large to convert to C long The above exception was the direct cause of the following exception: SystemError ``` I think the

Re: [sage-devel] Overflow error in `set_random_seed(1);a=(Integers(13)(2))**randint(2,2**4000-1)`

2023-08-12 Thread Dima Pasechnik
On Sat, Aug 12, 2023 at 10:04 AM Georgi Guninski wrote: > > ``` > set_random_seed(1);a=(Integers(13)(2))**randint(2,2**4000-1) > > OverflowError Traceback (most recent call last) > OverflowError: Python int too large to convert to C long > > The above exception was the

Re: [sage-devel] Overflow error in `set_random_seed(1);a=(Integers(13)(2))**randint(2,2**4000-1)`

2023-08-12 Thread Georgi Guninski
hi Dima, I am familiar with reduction modulo Euler totient, but it could be expensive to compute and in addition my testcase omits it on purpose :) btw, in the github issue the link to google groups appears broken. -- You received this message because you are subscribed to the Google Groups "sag

Re: [sage-devel] Overflow error in `set_random_seed(1);a=(Integers(13)(2))**randint(2,2**4000-1)`

2023-08-12 Thread Georgi Guninski
btw, why this code works? sage: a=Integers(13)(2);X=2**14000-19;a**X==a**(X%12) True -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@google

Re: [sage-devel] Overflow error in `set_random_seed(1);a=(Integers(13)(2))**randint(2,2**4000-1)`

2023-08-12 Thread Dima Pasechnik
On Sat, Aug 12, 2023 at 12:52 PM Georgi Guninski wrote: > > btw, why this code works? > > sage: a=Integers(13)(2);X=2**14000-19;a**X==a**(X%12) > True cause X has a different type here, so it does not hit the buggy line. > > -- > You received this message because you are subscribed to the Googl

[sage-devel] PyInt_AS_LONG trouble - obsolete stuff from Python2

2023-08-12 Thread Dima Pasechnik
In quite a few places in Sage code on still sees PyInt_AS_LONG - which is obsolete. Just recently is caused trouble: https://github.com/sagemath/sage/issues/36080 Some places have ad hoc redefines of it to PyLong_..., e.g. in src/sage/geometry/triangulation/triangulations.h: #define PyInt_AS_LONG