Skip to content

Commit

Permalink
Use 3.6 instead of 3.5 in float fract() documentation
Browse files Browse the repository at this point in the history
It is not self-explanatory whether the fract() function inverts the fractional part of negative numbers.

Co-Authored-By: Mateusz Mikuła <mati865@users.noreply.github.com>
  • Loading branch information
SOF3 and mati865 committed Jan 15, 2020
1 parent cb6122d commit 33bc9ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/libstd/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ impl f32 {
/// ```
/// use std::f32;
///
/// let x = 3.5_f32;
/// let y = -3.5_f32;
/// let abs_difference_x = (x.fract() - 0.5).abs();
/// let abs_difference_y = (y.fract() - (-0.5)).abs();
/// let x = 3.6_f32;
/// let y = -3.6_f32;
/// let abs_difference_x = (x.fract() - 0.6).abs();
/// let abs_difference_y = (y.fract() - (-0.6)).abs();
///
/// assert!(abs_difference_x <= f32::EPSILON);
/// assert!(abs_difference_y <= f32::EPSILON);
Expand Down
8 changes: 4 additions & 4 deletions src/libstd/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ impl f64 {
/// # Examples
///
/// ```
/// let x = 3.5_f64;
/// let y = -3.5_f64;
/// let abs_difference_x = (x.fract() - 0.5).abs();
/// let abs_difference_y = (y.fract() - (-0.5)).abs();
/// let x = 3.6_f64;
/// let y = -3.6_f64;
/// let abs_difference_x = (x.fract() - 0.6).abs();
/// let abs_difference_y = (y.fract() - (-0.6)).abs();
///
/// assert!(abs_difference_x < 1e-10);
/// assert!(abs_difference_y < 1e-10);
Expand Down

0 comments on commit 33bc9ef

Please sign in to comment.