factor_trial_division returns Python longs as exponents #13692

12 views
Skip to first unread message

Dima Pasechnik

unread,
Nov 8, 2012, 1:58:50 AM11/8/12
to sage-...@googlegroups.com
> On 2012-11-07, Nils Bruin <nbr...@sfu.ca> wrote:
>> ------=_Part_192_12193529.1352305182475
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>>
>>
>> On Tuesday, November 6, 2012 11:12:45 PM UTC-8, Rolandb wrote:
>>>
>>> Hi, have a look at:
>>>
>>> print [p for p in Integer(8).factor(limit=10^6)]
>>>
>>> [(2, 3L)]
>>>
>>>
>>> Is the 3L intended?
>>>
>> No. That's a "python multi precision integer" as generated by
>>
>> sage: long(10)
>> 10
>>
>> That's a crazy type for an exponent. It should be a sage Integer or if
>> absolutely required for efficiency reasons, a python "int".
> It come from here:
> sage: from sage.rings.factorint import factor_trial_division
> sage: [t for t in factor_trial_division(8)]
> [(2, 3L)]
>
if factor() gets limit= set to something, it calls this function.
I don't know whether factor_trial_division() must be fixed,
or just factor()...

I have opened #13692.

Dima

Reply all
Reply to author
Forward
0 new messages