Skip to content

Commit eece7aa

Browse files
committed
fix MAX_EXP docs
1 parent fae7785 commit eece7aa

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

library/core/src/num/f128.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,22 @@ impl f128 {
194194
#[unstable(feature = "f128", issue = "116909")]
195195
pub const MAX: f128 = 1.18973149535723176508575932662800702e+4932_f128;
196196

197-
/// One greater than the minimum possible normal power of 2 exponent.
197+
/// One greater than the minimum possible *normal* power of 2 exponent
198+
/// for a significand bounded by 1 ≤ x < 2 (i.e. the IEEE definition).
199+
/// This corresponds to the exact minimum possible *normal* power of 2 exponent
200+
/// for a significand bounded by 0.5 ≤ x < 1 (i.e. the C definition).
198201
///
199-
/// If <i>x</i>&nbsp;=&nbsp;`MIN_EXP`, then normal numbers
200-
/// ≥&nbsp;0.5&nbsp;×&nbsp;2<sup><i>x</i></sup>.
202+
/// If <i>x</i>&nbsp;=&nbsp;`MIN_EXP`, then all normal numbers representable by this type are
203+
/// greater than or equal to 0.5&nbsp;×&nbsp;2<sup><i>x</i></sup>.
201204
#[unstable(feature = "f128", issue = "116909")]
202205
pub const MIN_EXP: i32 = -16_381;
203-
/// Maximum possible power of 2 exponent.
206+
/// One greater than the maximum possible power of 2 exponent
207+
/// for a significand bounded by 1 ≤ x < 2 (i.e. the IEEE definition).
208+
/// This corresponds to the exact maximum possible power of 2 exponent
209+
/// for a significand bounded by 0.5 ≤ x < 1 (i.e. the C definition).
204210
///
205-
/// If <i>x</i>&nbsp;=&nbsp;`MAX_EXP`, then normal numbers
206-
/// &lt;&nbsp;1&nbsp;×&nbsp;2<sup><i>x</i></sup>.
211+
/// If <i>x</i>&nbsp;=&nbsp;`MAX_EXP`, then all numbers representable by this type are
212+
/// less than 1&nbsp;×&nbsp;2<sup><i>x</i></sup>.
207213
#[unstable(feature = "f128", issue = "116909")]
208214
pub const MAX_EXP: i32 = 16_384;
209215

library/core/src/num/f16.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,13 @@ impl f16 {
189189
#[unstable(feature = "f16", issue = "116909")]
190190
pub const MAX: f16 = 6.5504e+4_f16;
191191

192-
/// One greater than the minimum possible normal power of 2 exponent.
192+
/// One greater than the minimum possible *normal* power of 2 exponent.
193193
///
194194
/// If <i>x</i>&nbsp;=&nbsp;`MIN_EXP`, then normal numbers
195195
/// ≥&nbsp;0.5&nbsp;×&nbsp;2<sup><i>x</i></sup>.
196196
#[unstable(feature = "f16", issue = "116909")]
197197
pub const MIN_EXP: i32 = -13;
198-
/// Maximum possible power of 2 exponent.
198+
/// One greater than the maximum possible power of 2 exponent.
199199
///
200200
/// If <i>x</i>&nbsp;=&nbsp;`MAX_EXP`, then normal numbers
201201
/// &lt;&nbsp;1&nbsp;×&nbsp;2<sup><i>x</i></sup>.

library/core/src/num/f32.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,13 @@ impl f32 {
440440
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
441441
pub const MAX: f32 = 3.40282347e+38_f32;
442442

443-
/// One greater than the minimum possible normal power of 2 exponent.
443+
/// One greater than the minimum possible *normal* power of 2 exponent.
444444
///
445445
/// If <i>x</i>&nbsp;=&nbsp;`MIN_EXP`, then normal numbers
446446
/// ≥&nbsp;0.5&nbsp;×&nbsp;2<sup><i>x</i></sup>.
447447
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
448448
pub const MIN_EXP: i32 = -125;
449-
/// Maximum possible power of 2 exponent.
449+
/// One greater than the maximum possible power of 2 exponent.
450450
///
451451
/// If <i>x</i>&nbsp;=&nbsp;`MAX_EXP`, then normal numbers
452452
/// &lt;&nbsp;1&nbsp;×&nbsp;2<sup><i>x</i></sup>.

library/core/src/num/f64.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -439,13 +439,13 @@ impl f64 {
439439
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
440440
pub const MAX: f64 = 1.7976931348623157e+308_f64;
441441

442-
/// One greater than the minimum possible normal power of 2 exponent.
442+
/// One greater than the minimum possible *normal* power of 2 exponent.
443443
///
444444
/// If <i>x</i>&nbsp;=&nbsp;`MIN_EXP`, then normal numbers
445445
/// ≥&nbsp;0.5&nbsp;×&nbsp;2<sup><i>x</i></sup>.
446446
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
447447
pub const MIN_EXP: i32 = -1021;
448-
/// Maximum possible power of 2 exponent.
448+
/// One greater than the maximum possible power of 2 exponent.
449449
///
450450
/// If <i>x</i>&nbsp;=&nbsp;`MAX_EXP`, then normal numbers
451451
/// &lt;&nbsp;1&nbsp;×&nbsp;2<sup><i>x</i></sup>.

0 commit comments

Comments
 (0)