@@ -73,8 +73,9 @@ mod cmath {
73
73
}
74
74
}
75
75
76
- // FIXME(#11621): These constants should be deprecated once CTFE is implemented
77
- // in favour of calling their respective functions in `Bounded` and `Float`.
76
+ // FIXME(#5527): These constants should be deprecated once associated
77
+ // constants are implemented in favour of referencing the respective
78
+ // members of `Bounded` and `Float`.
78
79
79
80
pub static RADIX : uint = 2 u;
80
81
@@ -83,9 +84,11 @@ pub static DIGITS: uint = 15u;
83
84
84
85
pub static EPSILON : f64 = 2.2204460492503131e-16_f64 ;
85
86
86
- /// Minimum normalized f64 value
87
- pub static MIN_VALUE : f64 = 2.2250738585072014e-308_f64 ;
88
- /// Maximum f64 value
87
+ /// Smallest finite f64 value
88
+ pub static MIN_VALUE : f64 = -1.7976931348623157e+308_f64 ;
89
+ /// Smallest positive, normalized f64 value
90
+ pub static MIN_POS_VALUE : f64 = 2.2250738585072014e-308_f64 ;
91
+ /// Largest finite f64 value
89
92
pub static MAX_VALUE : f64 = 1.7976931348623157e+308_f64 ;
90
93
91
94
pub static MIN_EXP : int = -1021 ;
@@ -104,8 +107,9 @@ pub static NEG_INFINITY: f64 = -1.0_f64/0.0_f64;
104
107
pub mod consts {
105
108
// FIXME: replace with mathematical constants from cmath.
106
109
107
- // FIXME(#11621): These constants should be deprecated once CTFE is
108
- // implemented in favour of calling their respective functions in `Float`.
110
+ // FIXME(#5527): These constants should be deprecated once associated
111
+ // constants are implemented in favour of referencing the respective members
112
+ // of `Float`.
109
113
110
114
/// Archimedes' constant
111
115
pub static PI : f64 = 3.14159265358979323846264338327950288_f64 ;
@@ -330,25 +334,28 @@ impl Float for f64 {
330
334
}
331
335
332
336
#[ inline]
333
- fn mantissa_digits ( _: Option < f64 > ) -> uint { 53 }
337
+ fn mantissa_digits ( _: Option < f64 > ) -> uint { MANTISSA_DIGITS }
334
338
335
339
#[ inline]
336
- fn digits ( _: Option < f64 > ) -> uint { 15 }
340
+ fn digits ( _: Option < f64 > ) -> uint { DIGITS }
337
341
338
342
#[ inline]
339
- fn epsilon ( ) -> f64 { 2.2204460492503131e-16 }
343
+ fn epsilon ( ) -> f64 { EPSILON }
340
344
341
345
#[ inline]
342
- fn min_exp ( _: Option < f64 > ) -> int { - 1021 }
346
+ fn min_exp ( _: Option < f64 > ) -> int { MIN_EXP }
343
347
344
348
#[ inline]
345
- fn max_exp ( _: Option < f64 > ) -> int { 1024 }
349
+ fn max_exp ( _: Option < f64 > ) -> int { MAX_EXP }
346
350
347
351
#[ inline]
348
- fn min_10_exp ( _: Option < f64 > ) -> int { - 307 }
352
+ fn min_10_exp ( _: Option < f64 > ) -> int { MIN_10_EXP }
349
353
350
354
#[ inline]
351
- fn max_10_exp ( _: Option < f64 > ) -> int { 308 }
355
+ fn max_10_exp ( _: Option < f64 > ) -> int { MAX_10_EXP }
356
+
357
+ #[ inline]
358
+ fn min_pos_value ( _: Option < f64 > ) -> f64 { MIN_POS_VALUE }
352
359
353
360
/// Constructs a floating point number by multiplying `x` by 2 raised to the
354
361
/// power of `exp`
0 commit comments