@@ -221,8 +221,21 @@ impl f128 {
221221 pub const MAX_10_EXP : i32 = 4_932 ;
222222
223223 /// Returns `true` if this value is NaN.
224+ ///
225+ /// ```
226+ /// #![feature(f128)]
227+ /// # #[cfg(target_arch = "x86_64")] { // FIXME(f16_f128): remove when `unordtf2` is available
228+ ///
229+ /// let nan = f128::NAN;
230+ /// let f = 7.0_f128;
231+ ///
232+ /// assert!(nan.is_nan());
233+ /// assert!(!f.is_nan());
234+ /// # }
235+ /// ```
224236 #[ inline]
225237 #[ must_use]
238+ #[ cfg( not( bootstrap) ) ]
226239 #[ unstable( feature = "f128" , issue = "116909" ) ]
227240 #[ allow( clippy:: eq_op) ] // > if you intended to check if the operand is NaN, use `.is_nan()` instead :)
228241 pub const fn is_nan ( self ) -> bool {
@@ -234,7 +247,7 @@ impl f128 {
234247 /// meaning to the sign bit in case of a NaN, and as Rust doesn't guarantee that
235248 /// the bit pattern of NaNs are conserved over arithmetic operations, the result of
236249 /// `is_sign_positive` on a NaN might produce an unexpected result in some cases.
237- /// See [explanation of NaN as a special value](f32 ) for more info.
250+ /// See [explanation of NaN as a special value](f128 ) for more info.
238251 ///
239252 /// ```
240253 /// #![feature(f128)]
@@ -257,7 +270,7 @@ impl f128 {
257270 /// meaning to the sign bit in case of a NaN, and as Rust doesn't guarantee that
258271 /// the bit pattern of NaNs are conserved over arithmetic operations, the result of
259272 /// `is_sign_negative` on a NaN might produce an unexpected result in some cases.
260- /// See [explanation of NaN as a special value](f32 ) for more info.
273+ /// See [explanation of NaN as a special value](f128 ) for more info.
261274 ///
262275 /// ```
263276 /// #![feature(f128)]
@@ -287,6 +300,14 @@ impl f128 {
287300 ///
288301 /// Note that this function is distinct from `as` casting, which attempts to
289302 /// preserve the *numeric* value, and not the bitwise value.
303+ ///
304+ /// ```
305+ /// #![feature(f128)]
306+ ///
307+ /// # // FIXME(f16_f128): enable this once const casting works
308+ /// # // assert_ne!((1f128).to_bits(), 1f128 as u128); // to_bits() is not casting!
309+ /// assert_eq!((12.5f128).to_bits(), 0x40029000000000000000000000000000);
310+ /// ```
290311 #[ inline]
291312 #[ unstable( feature = "f128" , issue = "116909" ) ]
292313 #[ must_use = "this returns the result of the operation, without modifying the original" ]
@@ -326,6 +347,15 @@ impl f128 {
326347 ///
327348 /// Note that this function is distinct from `as` casting, which attempts to
328349 /// preserve the *numeric* value, and not the bitwise value.
350+ ///
351+ /// ```
352+ /// #![feature(f128)]
353+ /// # #[cfg(target_arch = "x86_64")] { // FIXME(f16_f128): remove when `eqtf2` is available
354+ ///
355+ /// let v = f128::from_bits(0x40029000000000000000000000000000);
356+ /// assert_eq!(v, 12.5);
357+ /// # }
358+ /// ```
329359 #[ inline]
330360 #[ must_use]
331361 #[ unstable( feature = "f128" , issue = "116909" ) ]
0 commit comments