about summary refs log tree commit diff
path: root/src/doc/tutorial.md
diff options
context:
space:
mode:
authorJag Talon <talon.jag@gmail.com>2014-02-24 08:36:23 -0500
committerAlex Crichton <alex@alexcrichton.com>2014-02-24 21:22:27 -0800
commit7fc7c377630717d19d38abeaf76b7c0a5229cc68 (patch)
treec5a66f726ffce31a7c0a2a84b3797f7576bfec26 /src/doc/tutorial.md
parent54abbda9b4f9ead316413d2ec5bef926c8bede18 (diff)
downloadrust-7fc7c377630717d19d38abeaf76b7c0a5229cc68.tar.gz
rust-7fc7c377630717d19d38abeaf76b7c0a5229cc68.zip
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
Diffstat (limited to 'src/doc/tutorial.md')
-rw-r--r--src/doc/tutorial.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md
index c2469e0c171..41bf15c0c14 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;