Skip to content

Commit 2d13ff1

Browse files
committed
fix f*::MAX_EXP and MIN_EXP docs
1 parent fae7785 commit 2d13ff1

File tree

4 files changed

+48
-24
lines changed

4 files changed

+48
-24
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+
/// In other words, all normal numbers representable by this type are
203+
/// greater than or equal to 0.5&nbsp;×&nbsp;2<sup><i>MIN_EXP</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+
/// In other words, all numbers representable by this type are
212+
/// strictly less than 2<sup><i>MAX_EXP</i></sup>.
207213
#[unstable(feature = "f128", issue = "116909")]
208214
pub const MAX_EXP: i32 = 16_384;
209215

library/core/src/num/f16.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,22 @@ 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
193+
/// for a significand bounded by 1 ≤ x < 2 (i.e. the IEEE definition).
194+
/// This corresponds to the exact minimum possible *normal* power of 2 exponent
195+
/// for a significand bounded by 0.5 ≤ x < 1 (i.e. the C definition).
193196
///
194-
/// If <i>x</i>&nbsp;=&nbsp;`MIN_EXP`, then normal numbers
195-
/// ≥&nbsp;0.5&nbsp;×&nbsp;2<sup><i>x</i></sup>.
197+
/// In other words, all normal numbers representable by this type are
198+
/// greater than or equal to 0.5&nbsp;×&nbsp;2<sup><i>MIN_EXP</i></sup>.
196199
#[unstable(feature = "f16", issue = "116909")]
197200
pub const MIN_EXP: i32 = -13;
198-
/// Maximum possible power of 2 exponent.
201+
/// One greater than the maximum possible power of 2 exponent
202+
/// for a significand bounded by 1 ≤ x < 2 (i.e. the IEEE definition).
203+
/// This corresponds to the exact maximum possible power of 2 exponent
204+
/// for a significand bounded by 0.5 ≤ x < 1 (i.e. the C definition).
199205
///
200-
/// If <i>x</i>&nbsp;=&nbsp;`MAX_EXP`, then normal numbers
201-
/// &lt;&nbsp;1&nbsp;×&nbsp;2<sup><i>x</i></sup>.
206+
/// In other words, all numbers representable by this type are
207+
/// strictly less than 2<sup><i>MAX_EXP</i></sup>.
202208
#[unstable(feature = "f16", issue = "116909")]
203209
pub const MAX_EXP: i32 = 16;
204210

library/core/src/num/f32.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -440,16 +440,22 @@ 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
444+
/// for a significand bounded by 1 ≤ x < 2 (i.e. the IEEE definition).
445+
/// This corresponds to the exact minimum possible *normal* power of 2 exponent
446+
/// for a significand bounded by 0.5 ≤ x < 1 (i.e. the C definition).
444447
///
445-
/// If <i>x</i>&nbsp;=&nbsp;`MIN_EXP`, then normal numbers
446-
/// ≥&nbsp;0.5&nbsp;×&nbsp;2<sup><i>x</i></sup>.
448+
/// In other words, all normal numbers representable by this type are
449+
/// greater than or equal to 0.5&nbsp;×&nbsp;2<sup><i>MIN_EXP</i></sup>.
447450
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
448451
pub const MIN_EXP: i32 = -125;
449-
/// Maximum possible power of 2 exponent.
452+
/// One greater than the maximum possible power of 2 exponent
453+
/// for a significand bounded by 1 ≤ x < 2 (i.e. the IEEE definition).
454+
/// This corresponds to the exact maximum possible power of 2 exponent
455+
/// for a significand bounded by 0.5 ≤ x < 1 (i.e. the C definition).
450456
///
451-
/// If <i>x</i>&nbsp;=&nbsp;`MAX_EXP`, then normal numbers
452-
/// &lt;&nbsp;1&nbsp;×&nbsp;2<sup><i>x</i></sup>.
457+
/// In other words, all numbers representable by this type are
458+
/// strictly less than 2<sup><i>MAX_EXP</i></sup>.
453459
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
454460
pub const MAX_EXP: i32 = 128;
455461

library/core/src/num/f64.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -439,16 +439,22 @@ 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
443+
/// for a significand bounded by 1 ≤ x < 2 (i.e. the IEEE definition).
444+
/// This corresponds to the exact minimum possible *normal* power of 2 exponent
445+
/// for a significand bounded by 0.5 ≤ x < 1 (i.e. the C definition).
443446
///
444-
/// If <i>x</i>&nbsp;=&nbsp;`MIN_EXP`, then normal numbers
445-
/// ≥&nbsp;0.5&nbsp;×&nbsp;2<sup><i>x</i></sup>.
447+
/// In other words, all normal numbers representable by this type are
448+
/// greater than or equal to 0.5&nbsp;×&nbsp;2<sup><i>MIN_EXP</i></sup>.
446449
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
447450
pub const MIN_EXP: i32 = -1021;
448-
/// Maximum possible power of 2 exponent.
451+
/// One greater than the maximum possible power of 2 exponent
452+
/// for a significand bounded by 1 ≤ x < 2 (i.e. the IEEE definition).
453+
/// This corresponds to the exact maximum possible power of 2 exponent
454+
/// for a significand bounded by 0.5 ≤ x < 1 (i.e. the C definition).
449455
///
450-
/// If <i>x</i>&nbsp;=&nbsp;`MAX_EXP`, then normal numbers
451-
/// &lt;&nbsp;1&nbsp;×&nbsp;2<sup><i>x</i></sup>.
456+
/// In other words, all numbers representable by this type are
457+
/// strictly less than 2<sup><i>MAX_EXP</i></sup>.
452458
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
453459
pub const MAX_EXP: i32 = 1024;
454460

0 commit comments

Comments
 (0)