Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
add min, max, range, distances #196
Conversation
Overall, you are naming things not really good, trying to see this doc as reference: https://github.com/unknwon/go-code-convention/blob/master/en-US/naming_rules.md#:~:text=Variable%20name%20is%20generally%20using,e.g.%20APIClient%20%2C%20repoID%20%2C%20UserID%20. Also, find a more meaningful variable name for your variables. |
) | ||
|
||
// absolute value, also implemented in "math" as math.Abs | ||
func abs(a float64) float64 { |
return max(numbers) - min(numbers) | ||
} | ||
|
||
func main() { |
} | ||
|
||
//find the largest distance from 0 | ||
func maxDist(numbers []float64) float64 { |
added min, min distance from 0, max, max distance from 0 and range on a list of numbers