Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math: It would be nice if the math.Min and math.Max functions accepted a variadic param #14246

Closed
watzon opened this issue Feb 6, 2016 · 1 comment

Comments

@watzon
Copy link

watzon commented Feb 6, 2016

Something like this would be nice:

func min(nums ...int) int {
  number = nums[0]
  for i := 1; i < len(nums); i++ {
    if (nums[i] < number) {
      number = nums[i]
    }
  }
  return number
}
@ianlancetaylor
Copy link
Contributor

We can't change the signature of the existing functions, as it would break the Go 1 compatibility guarantee.

@golang golang locked and limited conversation to collaborators Feb 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants