@@ -356,38 +356,76 @@ impl f64 {
356
356
#[ stable( feature = "assoc_int_consts" , since = "1.43.0" ) ]
357
357
pub const MANTISSA_DIGITS : u32 = 53 ;
358
358
/// Approximate number of significant digits in base 10.
359
+ ///
360
+ /// This is the maximum <i>x</i> such that any decimal number with <i>x</i>
361
+ /// significant digits can be converted to `f64` and back without loss.
362
+ ///
363
+ /// Equal to floor(log<sub>10</sub> 2<sup>[`MANTISSA_DIGITS`] − 1</sup>).
364
+ ///
365
+ /// [`MANTISSA_DIGITS`]: f64::MANTISSA_DIGITS
359
366
#[ stable( feature = "assoc_int_consts" , since = "1.43.0" ) ]
360
367
pub const DIGITS : u32 = 15 ;
361
368
362
369
/// [Machine epsilon] value for `f64`.
363
370
///
364
371
/// This is the difference between `1.0` and the next larger representable number.
365
372
///
373
+ /// Equal to 2<sup>1 − [`MANTISSA_DIGITS`]</sup>.
374
+ ///
366
375
/// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon
376
+ /// [`MANTISSA_DIGITS`]: f64::MANTISSA_DIGITS
367
377
#[ stable( feature = "assoc_int_consts" , since = "1.43.0" ) ]
368
378
pub const EPSILON : f64 = 2.2204460492503131e-16_f64 ;
369
379
370
380
/// Smallest finite `f64` value.
381
+ ///
382
+ /// Equal to −[`MAX`].
383
+ ///
384
+ /// [`MAX`]: f64::MAX
371
385
#[ stable( feature = "assoc_int_consts" , since = "1.43.0" ) ]
372
386
pub const MIN : f64 = -1.7976931348623157e+308_f64 ;
373
387
/// Smallest positive normal `f64` value.
388
+ ///
389
+ /// Equal to 2<sup>[`MIN_EXP`] − 1</sup>.
390
+ ///
391
+ /// [`MIN_EXP`]: f64::MIN_EXP
374
392
#[ stable( feature = "assoc_int_consts" , since = "1.43.0" ) ]
375
393
pub const MIN_POSITIVE : f64 = 2.2250738585072014e-308_f64 ;
376
394
/// Largest finite `f64` value.
395
+ ///
396
+ /// Equal to
397
+ /// (1 − 2<sup>−[`MANTISSA_DIGITS`]</sup>) 2<sup>[`MAX_EXP`]</sup>.
398
+ ///
399
+ /// [`MANTISSA_DIGITS`]: f64::MANTISSA_DIGITS
400
+ /// [`MAX_EXP`]: f64::MAX_EXP
377
401
#[ stable( feature = "assoc_int_consts" , since = "1.43.0" ) ]
378
402
pub const MAX : f64 = 1.7976931348623157e+308_f64 ;
379
403
380
404
/// One greater than the minimum possible normal power of 2 exponent.
405
+ ///
406
+ /// If <i>x</i> = `MIN_EXP`, then normal numbers
407
+ /// ≥ 0.5 × 2<sup><i>x</i></sup>.
381
408
#[ stable( feature = "assoc_int_consts" , since = "1.43.0" ) ]
382
409
pub const MIN_EXP : i32 = -1021 ;
383
410
/// Maximum possible power of 2 exponent.
411
+ ///
412
+ /// If <i>x</i> = `MAX_EXP`, then normal numbers
413
+ /// < 1 × 2<sup><i>x</i></sup>.
384
414
#[ stable( feature = "assoc_int_consts" , since = "1.43.0" ) ]
385
415
pub const MAX_EXP : i32 = 1024 ;
386
416
387
- /// Minimum possible normal power of 10 exponent.
417
+ /// Minimum <i>x</i> for which 10<sup><i>x</i></sup> is normal.
418
+ ///
419
+ /// Equal to ceil(log<sub>10</sub> [`MIN_POSITIVE`]).
420
+ ///
421
+ /// [`MIN_POSITIVE`]: f64::MIN_POSITIVE
388
422
#[ stable( feature = "assoc_int_consts" , since = "1.43.0" ) ]
389
423
pub const MIN_10_EXP : i32 = -307 ;
390
- /// Maximum possible power of 10 exponent.
424
+ /// Maximum <i>x</i> for which 10<sup><i>x</i></sup> is normal.
425
+ ///
426
+ /// Equal to floor(log<sub>10</sub> [`MAX`]).
427
+ ///
428
+ /// [`MAX`]: f64::MAX
391
429
#[ stable( feature = "assoc_int_consts" , since = "1.43.0" ) ]
392
430
pub const MAX_10_EXP : i32 = 308 ;
393
431
0 commit comments