File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1866,15 +1866,15 @@ pub trait Float: Num + Copy + NumCast + PartialOrd + Neg<Output = Self> {
18661866 /// ```
18671867 /// use num_traits::Float;
18681868 ///
1869- /// let num = 2.0f32 ;
1869+ /// let num = 42_f32 ;
18701870 ///
1871- /// // (8388608 , -22 , 1)
1871+ /// // (11010048 , -18 , 1)
18721872 /// let (mantissa, exponent, sign) = Float::integer_decode(num);
18731873 /// let sign_f = sign as f32;
18741874 /// let mantissa_f = mantissa as f32;
18751875 /// let exponent_f = exponent as f32;
18761876 ///
1877- /// // 1 * 8388608 * 2^(-22 ) == 2
1877+ /// // 1 * 11010048 * 2^(-18 ) == 42
18781878 /// let abs_difference = (sign_f * mantissa_f * 2_f32.powf(exponent_f) - num).abs();
18791879 ///
18801880 /// assert!(abs_difference < 1e-10);
You can’t perform that action at this time.
0 commit comments