From 35477be22af8f49b508e1db6f0a1d1d293a33b89 Mon Sep 17 00:00:00 2001 From: Jag Talon Date: Mon, 24 Feb 2014 08:36:23 -0500 Subject: [PATCH] Tutorial: Add std::num::sqrt to the example. We should be using the package std::num::sqrt instead of the sqrt function that was defined to return 0.0 --- src/doc/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index 2e6a0ef7e5bcb..004c9aa221e6e 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -1420,8 +1420,8 @@ bad, but often copies are expensive. So we’d like to define a function that takes the points by pointer. We can use references to do this: ~~~ +use std::num::sqrt; # struct Point { x: f64, y: f64 } -# fn sqrt(f: f64) -> f64 { 0.0 } fn compute_distance(p1: &Point, p2: &Point) -> f64 { let x_d = p1.x - p2.x; let y_d = p1.y - p2.y;