Open igavrysh opened 6 years ago
I ll give you a hint how to use assert in this case:
let delta = pow(10, -9)
let radius = 12
assert(abs(Circle(radius: radius).area - pow(radius, 2) * pi) < delta)
let height = 34
assert(Square(side: height).area == pow(height, 2))
assert(Square(side: height).perimeter == height * 4)
let width = 5
assert(Rectangle(width:widht, height: height).area == 2 * width * height)
added asserts without Circle().perimeter
https://github.com/SCherkasov/MyPlayground/blob/dd5196d81e5e6f50dd8a4aab9c00a23b6b5459bd/MyPlayground.playground/Contents.swift#L64-L77