Skip to content

Commit b2dc618

Browse files
committed
Add usage recommendation to old float constants
1 parent 83191c2 commit b2dc618

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/libcore/num/f32.rs

+14
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,21 @@ use crate::mem;
1717
use crate::num::FpCategory;
1818

1919
/// The radix or base of the internal representation of `f32`.
20+
/// Use [`f32::RADIX`](../../std/primitive.f32.html#associatedconstant.RADIX) instead.
2021
#[stable(feature = "rust1", since = "1.0.0")]
2122
pub const RADIX: u32 = f32::RADIX;
2223

2324
/// Number of significant digits in base 2.
25+
/// Use [`f32::MANTISSA_DIGITS`](../../std/primitive.f32.html#associatedconstant.MANTISSA_DIGITS) instead.
2426
#[stable(feature = "rust1", since = "1.0.0")]
2527
pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;
2628
/// Approximate number of significant digits in base 10.
29+
/// Use [`f32::DIGITS`](../../std/primitive.f32.html#associatedconstant.DIGITS) instead.
2730
#[stable(feature = "rust1", since = "1.0.0")]
2831
pub const DIGITS: u32 = f32::DIGITS;
2932

3033
/// [Machine epsilon] value for `f32`.
34+
/// Use [`f32::EPSILON`](../../std/primitive.f32.html#associatedconstant.EPSILON) instead.
3135
///
3236
/// This is the difference between `1.0` and the next larger representable number.
3337
///
@@ -36,36 +40,46 @@ pub const DIGITS: u32 = f32::DIGITS;
3640
pub const EPSILON: f32 = f32::EPSILON;
3741

3842
/// Smallest finite `f32` value.
43+
/// Use [`f32::MIN`](../../std/primitive.f32.html#associatedconstant.MIN) instead.
3944
#[stable(feature = "rust1", since = "1.0.0")]
4045
pub const MIN: f32 = f32::MIN;
4146
/// Smallest positive normal `f32` value.
47+
/// Use [`f32::MIN_POSITIVE`](../../std/primitive.f32.html#associatedconstant.MIN_POSITIVE) instead.
4248
#[stable(feature = "rust1", since = "1.0.0")]
4349
pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
4450
/// Largest finite `f32` value.
51+
/// Use [`f32::MAX`](../../std/primitive.f32.html#associatedconstant.MAX) instead.
4552
#[stable(feature = "rust1", since = "1.0.0")]
4653
pub const MAX: f32 = f32::MAX;
4754

4855
/// One greater than the minimum possible normal power of 2 exponent.
56+
/// Use [`f32::MIN_EXP`](../../std/primitive.f32.html#associatedconstant.MIN_EXP) instead.
4957
#[stable(feature = "rust1", since = "1.0.0")]
5058
pub const MIN_EXP: i32 = f32::MIN_EXP;
5159
/// Maximum possible power of 2 exponent.
60+
/// Use [`f32::MAX_EXP`](../../std/primitive.f32.html#associatedconstant.MAX_EXP) instead.
5261
#[stable(feature = "rust1", since = "1.0.0")]
5362
pub const MAX_EXP: i32 = f32::MAX_EXP;
5463

5564
/// Minimum possible normal power of 10 exponent.
65+
/// Use [`f32::MIN_10_EXP`](../../std/primitive.f32.html#associatedconstant.MIN_10_EXP) instead.
5666
#[stable(feature = "rust1", since = "1.0.0")]
5767
pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;
5868
/// Maximum possible power of 10 exponent.
69+
/// Use [`f32::MAX_10_EXP`](../../std/primitive.f32.html#associatedconstant.MAX_10_EXP) instead.
5970
#[stable(feature = "rust1", since = "1.0.0")]
6071
pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;
6172

6273
/// Not a Number (NaN).
74+
/// Use [`f32::NAN`](../../std/primitive.f32.html#associatedconstant.NAN) instead.
6375
#[stable(feature = "rust1", since = "1.0.0")]
6476
pub const NAN: f32 = f32::NAN;
6577
/// Infinity (∞).
78+
/// Use [`f32::INFINITY`](../../std/primitive.f32.html#associatedconstant.INFINITY) instead.
6679
#[stable(feature = "rust1", since = "1.0.0")]
6780
pub const INFINITY: f32 = f32::INFINITY;
6881
/// Negative infinity (−∞).
82+
/// Use [`f32::NEG_INFINITY`](../../std/primitive.f32.html#associatedconstant.NEG_INFINITY) instead.
6983
#[stable(feature = "rust1", since = "1.0.0")]
7084
pub const NEG_INFINITY: f32 = f32::NEG_INFINITY;
7185

src/libcore/num/f64.rs

+14
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,21 @@ use crate::mem;
1717
use crate::num::FpCategory;
1818

1919
/// The radix or base of the internal representation of `f64`.
20+
/// Use [`f64::RADIX`](../../std/primitive.f64.html#associatedconstant.RADIX) instead.
2021
#[stable(feature = "rust1", since = "1.0.0")]
2122
pub const RADIX: u32 = f64::RADIX;
2223

2324
/// Number of significant digits in base 2.
25+
/// Use [`f64::MANTISSA_DIGITS`](../../std/primitive.f64.html#associatedconstant.MANTISSA_DIGITS) instead.
2426
#[stable(feature = "rust1", since = "1.0.0")]
2527
pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS;
2628
/// Approximate number of significant digits in base 10.
29+
/// Use [`f64::DIGITS`](../../std/primitive.f64.html#associatedconstant.DIGITS) instead.
2730
#[stable(feature = "rust1", since = "1.0.0")]
2831
pub const DIGITS: u32 = f64::DIGITS;
2932

3033
/// [Machine epsilon] value for `f64`.
34+
/// Use [`f64::EPSILON`](../../std/primitive.f64.html#associatedconstant.EPSILON) instead.
3135
///
3236
/// This is the difference between `1.0` and the next larger representable number.
3337
///
@@ -36,36 +40,46 @@ pub const DIGITS: u32 = f64::DIGITS;
3640
pub const EPSILON: f64 = f64::EPSILON;
3741

3842
/// Smallest finite `f64` value.
43+
/// Use [`f64::MIN`](../../std/primitive.f64.html#associatedconstant.MIN) instead.
3944
#[stable(feature = "rust1", since = "1.0.0")]
4045
pub const MIN: f64 = f64::MIN;
4146
/// Smallest positive normal `f64` value.
47+
/// Use [`f64::MIN_POSITIVE`](../../std/primitive.f64.html#associatedconstant.MIN_POSITIVE) instead.
4248
#[stable(feature = "rust1", since = "1.0.0")]
4349
pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;
4450
/// Largest finite `f64` value.
51+
/// Use [`f64::MAX`](../../std/primitive.f64.html#associatedconstant.MAX) instead.
4552
#[stable(feature = "rust1", since = "1.0.0")]
4653
pub const MAX: f64 = f64::MAX;
4754

4855
/// One greater than the minimum possible normal power of 2 exponent.
56+
/// Use [`f64::MIN_EXP`](../../std/primitive.f64.html#associatedconstant.MIN_EXP) instead.
4957
#[stable(feature = "rust1", since = "1.0.0")]
5058
pub const MIN_EXP: i32 = f64::MIN_EXP;
5159
/// Maximum possible power of 2 exponent.
60+
/// Use [`f64::MAX_EXP`](../../std/primitive.f64.html#associatedconstant.MAX_EXP) instead.
5261
#[stable(feature = "rust1", since = "1.0.0")]
5362
pub const MAX_EXP: i32 = f64::MAX_EXP;
5463

5564
/// Minimum possible normal power of 10 exponent.
65+
/// Use [`f64::MIN_10_EXP`](../../std/primitive.f64.html#associatedconstant.MIN_10_EXP) instead.
5666
#[stable(feature = "rust1", since = "1.0.0")]
5767
pub const MIN_10_EXP: i32 = f64::MIN_10_EXP;
5868
/// Maximum possible power of 10 exponent.
69+
/// Use [`f64::MAX_10_EXP`](../../std/primitive.f64.html#associatedconstant.MAX_10_EXP) instead.
5970
#[stable(feature = "rust1", since = "1.0.0")]
6071
pub const MAX_10_EXP: i32 = f64::MAX_10_EXP;
6172

6273
/// Not a Number (NaN).
74+
/// Use [`f64::NAN`](../../std/primitive.f64.html#associatedconstant.NAN) instead.
6375
#[stable(feature = "rust1", since = "1.0.0")]
6476
pub const NAN: f64 = f64::NAN;
6577
/// Infinity (∞).
78+
/// Use [`f64::INFINITY`](../../std/primitive.f64.html#associatedconstant.INFINITY) instead.
6679
#[stable(feature = "rust1", since = "1.0.0")]
6780
pub const INFINITY: f64 = f64::INFINITY;
6881
/// Negative infinity (−∞).
82+
/// Use [`f64::NEG_INFINITY`](../../std/primitive.f64.html#associatedconstant.NEG_INFINITY) instead.
6983
#[stable(feature = "rust1", since = "1.0.0")]
7084
pub const NEG_INFINITY: f64 = f64::NEG_INFINITY;
7185

0 commit comments

Comments
 (0)