From 835960a3331bdabc7f6251a66c284fe0a3b98d10 Mon Sep 17 00:00:00 2001 From: eliovir Date: Tue, 24 Sep 2013 10:21:18 +0200 Subject: [PATCH] tutorial.md : correct formula in fn area() change formula (other solution could be using abs()). --- doc/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index 2f9a84d984f87..2a7bea002e7a1 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -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) } } }