-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: home_2_1
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
square.x * 4 ?
area() perimetr with tests