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

add min, max, range, distances #196

Open
wants to merge 1 commit into
base: master
from

Conversation

@SotirisGP
Copy link

@SotirisGP SotirisGP commented Oct 6, 2020

added min, min distance from 0, max, max distance from 0 and range on a list of numbers

Copy link
Collaborator

@nomisrevol nomisrevol left a comment

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 {

This comment has been minimized.

@nomisrevol

nomisrevol Oct 7, 2020
Collaborator

Please reuse the existence function.

return max(numbers) - min(numbers)
}

func main() {

This comment has been minimized.

@nomisrevol

nomisrevol Oct 7, 2020
Collaborator

Remove the main function and write the test file instead.

}

//find the largest distance from 0
func maxDist(numbers []float64) float64 {

This comment has been minimized.

@nomisrevol

nomisrevol Oct 7, 2020
Collaborator

Should rename to maxDistToZero, I think it is more meaningful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.