@@ -15,56 +15,56 @@ use crate::num::FpCategory;
1515
1616/// The radix or base of the internal representation of `f64`.
1717#[ stable( feature = "rust1" , since = "1.0.0" ) ]
18- pub const RADIX : u32 = 2 ;
18+ pub const RADIX : u32 = f64 :: RADIX ;
1919
2020/// Number of significant digits in base 2.
2121#[ stable( feature = "rust1" , since = "1.0.0" ) ]
22- pub const MANTISSA_DIGITS : u32 = 53 ;
22+ pub const MANTISSA_DIGITS : u32 = f64 :: MANTISSA_DIGITS ;
2323/// Approximate number of significant digits in base 10.
2424#[ stable( feature = "rust1" , since = "1.0.0" ) ]
25- pub const DIGITS : u32 = 15 ;
25+ pub const DIGITS : u32 = f64 :: DIGITS ;
2626
2727/// [Machine epsilon] value for `f64`.
2828///
2929/// This is the difference between `1.0` and the next larger representable number.
3030///
3131/// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon
3232#[ stable( feature = "rust1" , since = "1.0.0" ) ]
33- pub const EPSILON : f64 = 2.2204460492503131e-16_f64 ;
33+ pub const EPSILON : f64 = f64 :: EPSILON ;
3434
3535/// Smallest finite `f64` value.
3636#[ stable( feature = "rust1" , since = "1.0.0" ) ]
37- pub const MIN : f64 = - 1.7976931348623157e+308_f64 ;
37+ pub const MIN : f64 = f64 :: MIN ;
3838/// Smallest positive normal `f64` value.
3939#[ stable( feature = "rust1" , since = "1.0.0" ) ]
40- pub const MIN_POSITIVE : f64 = 2.2250738585072014e-308_f64 ;
40+ pub const MIN_POSITIVE : f64 = f64 :: MIN_POSITIVE ;
4141/// Largest finite `f64` value.
4242#[ stable( feature = "rust1" , since = "1.0.0" ) ]
43- pub const MAX : f64 = 1.7976931348623157e+308_f64 ;
43+ pub const MAX : f64 = f64 :: MAX ;
4444
4545/// One greater than the minimum possible normal power of 2 exponent.
4646#[ stable( feature = "rust1" , since = "1.0.0" ) ]
47- pub const MIN_EXP : i32 = - 1021 ;
47+ pub const MIN_EXP : i32 = f64 :: MIN_EXP ;
4848/// Maximum possible power of 2 exponent.
4949#[ stable( feature = "rust1" , since = "1.0.0" ) ]
50- pub const MAX_EXP : i32 = 1024 ;
50+ pub const MAX_EXP : i32 = f64 :: MAX_EXP ;
5151
5252/// Minimum possible normal power of 10 exponent.
5353#[ stable( feature = "rust1" , since = "1.0.0" ) ]
54- pub const MIN_10_EXP : i32 = - 307 ;
54+ pub const MIN_10_EXP : i32 = f64 :: MIN_10_EXP ;
5555/// Maximum possible power of 10 exponent.
5656#[ stable( feature = "rust1" , since = "1.0.0" ) ]
57- pub const MAX_10_EXP : i32 = 308 ;
57+ pub const MAX_10_EXP : i32 = f64 :: MAX_10_EXP ;
5858
5959/// Not a Number (NaN).
6060#[ stable( feature = "rust1" , since = "1.0.0" ) ]
61- pub const NAN : f64 = 0.0_f64 / 0.0_f64 ;
61+ pub const NAN : f64 = f64 :: NAN ;
6262/// Infinity (∞).
6363#[ stable( feature = "rust1" , since = "1.0.0" ) ]
64- pub const INFINITY : f64 = 1.0_f64 / 0.0_f64 ;
64+ pub const INFINITY : f64 = f64 :: INFINITY ;
6565/// Negative infinity (−∞).
6666#[ stable( feature = "rust1" , since = "1.0.0" ) ]
67- pub const NEG_INFINITY : f64 = - 1.0_f64 / 0.0_f64 ;
67+ pub const NEG_INFINITY : f64 = f64 :: NEG_INFINITY ;
6868
6969/// Basic mathematical constants.
7070#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -153,6 +153,59 @@ pub mod consts {
153153#[ lang = "f64" ]
154154#[ cfg( not( test) ) ]
155155impl f64 {
156+ /// The radix or base of the internal representation of `f64`.
157+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
158+ pub const RADIX : u32 = 2 ;
159+
160+ /// Number of significant digits in base 2.
161+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
162+ pub const MANTISSA_DIGITS : u32 = 53 ;
163+ /// Approximate number of significant digits in base 10.
164+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
165+ pub const DIGITS : u32 = 15 ;
166+
167+ /// [Machine epsilon] value for `f64`.
168+ ///
169+ /// This is the difference between `1.0` and the next larger representable number.
170+ ///
171+ /// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon
172+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
173+ pub const EPSILON : f64 = 2.2204460492503131e-16_f64 ;
174+
175+ /// Smallest finite `f64` value.
176+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
177+ pub const MIN : f64 = -1.7976931348623157e+308_f64 ;
178+ /// Smallest positive normal `f64` value.
179+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
180+ pub const MIN_POSITIVE : f64 = 2.2250738585072014e-308_f64 ;
181+ /// Largest finite `f64` value.
182+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
183+ pub const MAX : f64 = 1.7976931348623157e+308_f64 ;
184+
185+ /// One greater than the minimum possible normal power of 2 exponent.
186+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
187+ pub const MIN_EXP : i32 = -1021 ;
188+ /// Maximum possible power of 2 exponent.
189+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
190+ pub const MAX_EXP : i32 = 1024 ;
191+
192+ /// Minimum possible normal power of 10 exponent.
193+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
194+ pub const MIN_10_EXP : i32 = -307 ;
195+ /// Maximum possible power of 10 exponent.
196+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
197+ pub const MAX_10_EXP : i32 = 308 ;
198+
199+ /// Not a Number (NaN).
200+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
201+ pub const NAN : f64 = 0.0_f64 / 0.0_f64 ;
202+ /// Infinity (∞).
203+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
204+ pub const INFINITY : f64 = 1.0_f64 / 0.0_f64 ;
205+ /// Negative infinity (-∞).
206+ #[ unstable( feature = "assoc_int_consts" , reason = "recently added" , issue = "68490" ) ]
207+ pub const NEG_INFINITY : f64 = -1.0_f64 / 0.0_f64 ;
208+
156209 /// Returns `true` if this value is `NaN`.
157210 ///
158211 /// ```
0 commit comments