about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorJay Anderson <jayanderson0@gmail.com>2013-11-11 20:52:42 -0700
committerJay Anderson <jayanderson0@gmail.com>2013-11-11 20:52:42 -0700
commit8a4be8080b434fec90d8b519414f27e219971ace (patch)
tree1e013a866b0235939891d5dc9eb303eff05010f6 /src/libstd
parentdeefb1f4b7bb6fc9a4145d698bea9cbf5953bd03 (diff)
downloadrust-8a4be8080b434fec90d8b519414f27e219971ace.tar.gz
rust-8a4be8080b434fec90d8b519414f27e219971ace.zip
Use constants instead of raw values.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/num/mod.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs
index b21016e27d0..873d66d401e 100644
--- a/src/libstd/num/mod.rs
+++ b/src/libstd/num/mod.rs
@@ -268,10 +268,8 @@ pub trait Trigonometric {
     /// ```rust
     /// let y = 3f32.sqrt();
     /// let x = 1f32;
-    /// let pi_3 = 1.04719758f32;
-    /// assert_approx_eq!(y.atan2(&x), pi_3);
-    /// let neg_2_pi_3 = -2.09439516f32;
-    /// assert_approx_eq!((-y).atan2(&(-x)), neg_2_pi_3);
+    /// assert_approx_eq!(y.atan2(&x), f32::consts::PI / 3f32);
+    /// assert_approx_eq!((-y).atan2(&(-x)), - 2f32 * f32::consts::PI / 3f32);
     /// ```
     fn atan2(&self, other: &Self) -> Self;