On Tue, May 6, 2008 at 8:49 PM, schmmd <[EMAIL PROTECTED]> wrote:
>
>  lcm? gives the following output:
>
>  Type:           function
>  Base Class:     <type 'function'>
>  String Form:    <function lcm at 0x879087c>
>  Namespace:      Interactive
>  File:           /home/michael/downloads/sage-3.0/local/lib/python2.5/
>  site-packages/sage/rings/arith.py
>  Definition:     lcm(a, b=None, integer=False)
>  Docstring:
>
>         The least common multiple of a and b, or if a is a list and b
>  is
>         omitted the least common multiple of all elements of a.
>
>         NOTE: Use integer=True to make this vastly faster if you are
>         working with lists of integers.
>
>         INPUT:
>             a -- number
>             b -- number (optional)
>             integer -- (default: False); if True, do an integer LCM
>         or
>   *           a -- vector
>             integer -- (default: False); if True, do an integer LCM
>                 NOTE -- this is *vastly* faster than doing the generic
>  LCM
>
>  Note the starred line.  I believe that the lcm method takes a list and
>  not a vector.  At least, I seem to get errors when I pass a vector.
>
>

I fully agree that this is a bug.

Incidentally I wrote the LCM function a while before I implemented vectors,
so I think when I wrote those docs "vector" and "list" were the same
thing in my mind.

The fix should be to change the docs to replace "vector" by any itterable.
Then the LCM code should iterate over the object calling LCM
if it doesn't have an LCM method.

Probably similar fixes need to be made for GCD.

We are tracking this issue here:
    http://trac.sagemath.org/sage_trac/ticket/3118

William

--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to