[New-bugs-announce] [issue39648] Update math.gcd() to accept "n" arguments.

Ananthakrishnan report at bugs.python.org
Sun Feb 16 08:38:42 EST 2020

New submission from Ananthakrishnan <ananthakrishnan15.2001 at gmail.com>:

If we have to find the gcd of three or more numbers, now we should use 
gcd(a, gcd(b, gcd(c, gcd(d, e)))))
which will create lot of problems.

math.gcd should take "n" number of arguments,like:


gcd(4,6,8)    //returns 2
gcd(2,5,8,6)    //returns 1
gcd(6,30,40,60,20,40)    //returns 2

components: Library (Lib)
messages: 362069
nosy: Ananthakrishnan, mark.dickinson, serhiy.storchaka, steven.daprano
priority: normal
severity: normal
status: open
title: Update math.gcd() to accept "n" arguments.
versions: Python 3.9

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list