TypeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined

295 views
Skip to first unread message

Rolandb

unread,
Nov 7, 2012, 2:12:45 AM11/7/12
to sage-s...@googlegroups.com
Hi, have a look at:

print [p for p in Integer(8).factor(limit=10^6)]
[(2, 3L)]

Is the 3L intended?

The following line:
if 1/3*log(3L) != log(6L): print "Correct"

yields: TypeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined...

version 5.3 64b, Ubuntu 12.04.1

Rolandsolve · server · optimization · tsp

Nils Bruin

unread,
Nov 7, 2012, 11:19:42 AM11/7/12
to sage-s...@googlegroups.com


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".

The following line:
if 1/3*log(3L) != log(6L): print "Correct"

yields: TypeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined...

Yes, translation to maxima does not know about "python long" string literals. The expect interface stumbles too:

sage: maxima(1/3*log(long(3)) != log(long(6)))
TypeError: Error executing code in Maxima
...
Maxima ERROR:
    incorrect syntax: l is not an infix operator

Dima Pasechnik

unread,
Nov 8, 2012, 1:55:56 AM11/8/12
to sage-s...@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