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

home 4_2 area() perimetr with tests #10

Open
wants to merge 4 commits into
base: home_2_1
Choose a base branch
from
Open

home 4_2 area() perimetr with tests #10

wants to merge 4 commits into from

Conversation

opi-dopi
Copy link
Owner

@opi-dopi opi-dopi commented Nov 27, 2019

area() perimetr with tests

@opi-dopi opi-dopi changed the title home 4_2 home 4_2 area() perimetr with tests Dec 1, 2019
Copy link

@burov burov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks, ok just a few comments

home_42.go Outdated
}

type Square struct {
x, y float64
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is not need to use two sides length, in Square you can use only one

home_42.go Outdated
}

func (circle Circle) area() float64 {
return math.Floor(math.Pi*math.Pow(circle.r, 2)*100) / 100

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return math.Floor(math.Pi*math.Pow(circle.r, 2)*100) / 100
return math.Pi*math.Pow(circle.r, 2)

home_42.go Outdated
}

func (circle Circle) perimeter() float64 {
return math.Floor(2*math.Pi*circle.r*100) / 100

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return math.Floor(2*math.Pi*circle.r*100) / 100
return 2*math.Pi*circle.r

}

func (square Square) perimeter() float64 {
return square.x*2 + square.x*2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

square.x * 4 ?

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

Successfully merging this pull request may close these issues.

3 participants