@@ -1688,6 +1688,20 @@ pub trait Formatter {
1688
1688
}
1689
1689
1690
1690
/// Writes a floating point value like `-31.26e+12` to the specified writer.
1691
+ ///
1692
+ /// # Special cases
1693
+ ///
1694
+ /// This function **does not** check for NaN or infinity. If the input
1695
+ /// number is not a finite float, the printed representation will be some
1696
+ /// correctly formatted but unspecified numerical value.
1697
+ ///
1698
+ /// Please check [`is_finite`] yourself before calling this function, or
1699
+ /// check [`is_nan`] and [`is_infinite`] and handle those cases yourself
1700
+ /// with a different `Formatter` method.
1701
+ ///
1702
+ /// [`is_finite`]: f32::is_finite
1703
+ /// [`is_nan`]: f32::is_nan
1704
+ /// [`is_infinite`]: f32::is_infinite
1691
1705
#[ inline]
1692
1706
fn write_f32 < W > ( & mut self , writer : & mut W , value : f32 ) -> io:: Result < ( ) >
1693
1707
where
@@ -1699,6 +1713,20 @@ pub trait Formatter {
1699
1713
}
1700
1714
1701
1715
/// Writes a floating point value like `-31.26e+12` to the specified writer.
1716
+ ///
1717
+ /// # Special cases
1718
+ ///
1719
+ /// This function **does not** check for NaN or infinity. If the input
1720
+ /// number is not a finite float, the printed representation will be some
1721
+ /// correctly formatted but unspecified numerical value.
1722
+ ///
1723
+ /// Please check [`is_finite`] yourself before calling this function, or
1724
+ /// check [`is_nan`] and [`is_infinite`] and handle those cases yourself
1725
+ /// with a different `Formatter` method.
1726
+ ///
1727
+ /// [`is_finite`]: f64::is_finite
1728
+ /// [`is_nan`]: f64::is_nan
1729
+ /// [`is_infinite`]: f64::is_infinite
1702
1730
#[ inline]
1703
1731
fn write_f64 < W > ( & mut self , writer : & mut W , value : f64 ) -> io:: Result < ( ) >
1704
1732
where
0 commit comments