File tree 3 files changed +40
-1
lines changed
3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,16 @@ impl f128 {
228
228
/// the bit pattern of NaNs are conserved over arithmetic operations, the result of
229
229
/// `is_sign_positive` on a NaN might produce an unexpected result in some cases.
230
230
/// See [explanation of NaN as a special value](f32) for more info.
231
+ ///
232
+ /// ```
233
+ /// #![feature(f128)]
234
+ ///
235
+ /// let f = 7.0_f128;
236
+ /// let g = -7.0_f128;
237
+ ///
238
+ /// assert!(f.is_sign_positive());
239
+ /// assert!(!g.is_sign_positive());
240
+ /// ```
231
241
#[ inline]
232
242
#[ must_use]
233
243
#[ unstable( feature = "f128" , issue = "116909" ) ]
@@ -241,6 +251,16 @@ impl f128 {
241
251
/// the bit pattern of NaNs are conserved over arithmetic operations, the result of
242
252
/// `is_sign_negative` on a NaN might produce an unexpected result in some cases.
243
253
/// See [explanation of NaN as a special value](f32) for more info.
254
+ ///
255
+ /// ```
256
+ /// #![feature(f128)]
257
+ ///
258
+ /// let f = 7.0_f128;
259
+ /// let g = -7.0_f128;
260
+ ///
261
+ /// assert!(!f.is_sign_negative());
262
+ /// assert!(g.is_sign_negative());
263
+ /// ```
244
264
#[ inline]
245
265
#[ must_use]
246
266
#[ unstable( feature = "f128" , issue = "116909" ) ]
Original file line number Diff line number Diff line change @@ -224,6 +224,16 @@ impl f16 {
224
224
/// the bit pattern of NaNs are conserved over arithmetic operations, the result of
225
225
/// `is_sign_positive` on a NaN might produce an unexpected result in some cases.
226
226
/// See [explanation of NaN as a special value](f32) for more info.
227
+ ///
228
+ /// ```
229
+ /// #![feature(f16)]
230
+ ///
231
+ /// let f = 7.0_f16;
232
+ /// let g = -7.0_f16;
233
+ ///
234
+ /// assert!(f.is_sign_positive());
235
+ /// assert!(!g.is_sign_positive());
236
+ /// ```
227
237
#[ inline]
228
238
#[ must_use]
229
239
#[ unstable( feature = "f16" , issue = "116909" ) ]
@@ -237,6 +247,16 @@ impl f16 {
237
247
/// the bit pattern of NaNs are conserved over arithmetic operations, the result of
238
248
/// `is_sign_negative` on a NaN might produce an unexpected result in some cases.
239
249
/// See [explanation of NaN as a special value](f32) for more info.
250
+ ///
251
+ /// ```
252
+ /// #![feature(f16)]
253
+ ///
254
+ /// let f = 7.0_f16;
255
+ /// let g = -7.0_f16;
256
+ ///
257
+ /// assert!(!f.is_sign_negative());
258
+ /// assert!(g.is_sign_negative());
259
+ /// ```
240
260
#[ inline]
241
261
#[ must_use]
242
262
#[ unstable( feature = "f16" , issue = "116909" ) ]
Original file line number Diff line number Diff line change @@ -1111,7 +1111,6 @@ impl f64 {
1111
1111
/// ```
1112
1112
/// assert!((1f64).to_bits() != 1f64 as u64); // to_bits() is not casting!
1113
1113
/// assert_eq!((12.5f64).to_bits(), 0x4029000000000000);
1114
- ///
1115
1114
/// ```
1116
1115
#[ must_use = "this returns the result of the operation, \
1117
1116
without modifying the original"]
You can’t perform that action at this time.
0 commit comments