tutorial.md : correct formula in fn area()

change formula (other solution could be using abs()).
This commit is contained in:
eliovir 2013-09-24 10:21:18 +02:00
parent 18e3bcd1ab
commit 835960a333
1 changed files with 1 additions and 1 deletions

View File

@ -737,7 +737,7 @@ fn area(sh: Shape) -> float {
match sh {
Circle { radius: radius, _ } => float::consts::pi * square(radius),
Rectangle { top_left: top_left, bottom_right: bottom_right } => {
(bottom_right.x - top_left.x) * (bottom_right.y - top_left.y)
(bottom_right.x - top_left.x) * (top_left.y - bottom_right.y)
}
}
}