Message362082
> Should it take variable number of positional arguments or a single iterable argument as max() and min()?
Good question: the obvious extension to the current function would be to allow it to take multiple scalar arguments. But I don't much like the mismatch that introduces with `sum` and `math.prod`, which accept a single iterable argument.
I *definitely* don't want to give `gcd` a combination API like the one `min` and `max` have.
> What should it return for 0 arguments?
That one's easy. It should return `0`. `0` is an identity for the binary `gcd` operation, and mathematically, the `gcd` is defined for *any* set of integers (finite or infinite), including the empty set. The gcd of the empty set is zero. |
|
Date |
User |
Action |
Args |
2020-02-16 17:12:45 | mark.dickinson | set | recipients:
+ mark.dickinson, tim.peters, rhettinger, steven.daprano, SilentGhost, serhiy.storchaka, Ananthakrishnan |
2020-02-16 17:12:45 | mark.dickinson | set | messageid: <1581873165.13.0.111239909804.issue39648@roundup.psfhosted.org> |
2020-02-16 17:12:45 | mark.dickinson | link | issue39648 messages |
2020-02-16 17:12:45 | mark.dickinson | create | |
|