#9063: wrong type for denominator
-----------------------------------------+----------------------------------
Reporter: cjh | Owner: AlexGhitza
Type: defect | Status: needs_work
Priority: major | Milestone: sage-4.5.3
Component: algebra | Keywords:
Author: Luis Felipe Tabera Alonso | Upstream: N/A
Reviewer: John Cremona | Merged:
Work_issues: |
-----------------------------------------+----------------------------------
Comment(by cremona):
Replying to [comment:5 lftabera]:
> Well,
>
> The issue of adding a lcm function for finite fields has some problems
associated:
>
> - Except is degenerate cases, all elements are units, so the lcm being 1
is not nonsense.
>
> - The problem is that currently, sage already does some lcm for finite
fields if the elements can be coerced to ZZ.
>
> {{{
> sage: m = GF(5)
> sage: a= m(4)
> sage: lcm(a,a)
> 4
> }}}
>
> So this approach will add a backwards incompatibility at least.
Well spotted! I think that this current behavour is a bug:
{{{
sage: a = GF(5)(4)
sage: type(a)
<type 'sage.rings.finite_rings.integer_mod.IntegerMod_int'>
sage: lcm(a,a)
4
sage: type(lcm(a,a))
<type 'sage.rings.integer.Integer'>
}}}
since it makes no mathematical sense at all. It's the same for gcd:
{{{
sage: gcd(a,a)
4
sage: type(gcd(a,a))
<type 'sage.rings.integer.Integer'>
}}}
Both of these would not happen if finite field elements have gcd and lcm
methods, and in my opinion that would be better.
Someone should try to implement this and do a full test to see if any
existing code (tests) is broken. I hope not -- I cannot imagine anyone
relying on this rather crazy behaviour.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9063#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.