Skip to content

Commit 8a4be80

Browse files
committed
Use constants instead of raw values.
1 parent deefb1f commit 8a4be80

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libstd/num/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,8 @@ pub trait Trigonometric {
268268
/// ```rust
269269
/// let y = 3f32.sqrt();
270270
/// let x = 1f32;
271-
/// let pi_3 = 1.04719758f32;
272-
/// assert_approx_eq!(y.atan2(&x), pi_3);
273-
/// let neg_2_pi_3 = -2.09439516f32;
274-
/// assert_approx_eq!((-y).atan2(&(-x)), neg_2_pi_3);
271+
/// assert_approx_eq!(y.atan2(&x), f32::consts::PI / 3f32);
272+
/// assert_approx_eq!((-y).atan2(&(-x)), - 2f32 * f32::consts::PI / 3f32);
275273
/// ```
276274
fn atan2(&self, other: &Self) -> Self;
277275

0 commit comments

Comments
 (0)