#4988: major easy-to-fix but STUPID bug in gcd
---------------------------+------------------------------------------------
 Reporter:  was            |       Owner:  was     
     Type:  defect         |      Status:  new     
 Priority:  major          |   Milestone:  sage-3.3
Component:  number theory  |    Keywords:          
---------------------------+------------------------------------------------
 This is stupid:

 {{{
 sage: gcd(3,6,2)
 3
 }}}

 The problem is that there is an undocumented mysterious and not even used
 integer third input!
 {{{
 File:        /Users/was/s/local/lib/python2.5/site-
 packages/sage/rings/arith.py
 Type:        <type 'function'>
 Definition:  gcd(a, b, integer, **kwargs)
 Docstring:

     The greatest common divisor of a and b, or if a is a list and b is
     omitted the greatest common divisor of all elements of a.

     INPUT:
         a,b -- two elements of a ring with gcd
     or
         a -- a list or tuple of elements of a ring with gcd

     Additional keyword arguments are passed to the respectively called
     methods.

     EXAMPLES:
         sage: GCD(97,100)
         1
         sage: GCD(97*10^15, 19^20*97^2)
         97
         sage: GCD(2/3, 4/3)
         2/3
         sage: GCD([2,4,6,8])
         2
         sage: GCD(srange(0,10000,10))  # fast  !!
         10
 }}}

 This caused me a ton of confusion just now.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4988>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to