@@ -197,16 +197,22 @@ impl f128 {
197197 #[ unstable( feature = "f128" , issue = "116909" ) ]
198198 pub const MAX : f128 = 1.18973149535723176508575932662800702e+4932_f128 ;
199199
200- /// One greater than the minimum possible normal power of 2 exponent.
200+ /// One greater than the minimum possible *normal* power of 2 exponent
201+ /// for a significand bounded by 1 ≤ x < 2 (i.e. the IEEE definition).
201202 ///
202- /// If <i>x</i> = `MIN_EXP`, then normal numbers
203- /// ≥ 0.5 × 2<sup><i>x</i></sup>.
203+ /// This corresponds to the exact minimum possible *normal* power of 2 exponent
204+ /// for a significand bounded by 0.5 ≤ x < 1 (i.e. the C definition).
205+ /// In other words, all normal numbers representable by this type are
206+ /// greater than or equal to 0.5 × 2<sup><i>MIN_EXP</i></sup>.
204207 #[ unstable( feature = "f128" , issue = "116909" ) ]
205208 pub const MIN_EXP : i32 = -16_381 ;
206- /// Maximum possible power of 2 exponent.
209+ /// One greater than the maximum possible power of 2 exponent
210+ /// for a significand bounded by 1 ≤ x < 2 (i.e. the IEEE definition).
207211 ///
208- /// If <i>x</i> = `MAX_EXP`, then normal numbers
209- /// < 1 × 2<sup><i>x</i></sup>.
212+ /// This corresponds to the exact maximum possible power of 2 exponent
213+ /// for a significand bounded by 0.5 ≤ x < 1 (i.e. the C definition).
214+ /// In other words, all numbers representable by this type are
215+ /// strictly less than 2<sup><i>MAX_EXP</i></sup>.
210216 #[ unstable( feature = "f128" , issue = "116909" ) ]
211217 pub const MAX_EXP : i32 = 16_384 ;
212218
@@ -804,7 +810,7 @@ impl f128 {
804810 }
805811 }
806812
807- /// Calculates the middle point of `self` and `rhs`.
813+ /// Calculates the midpoint (average) between `self` and `rhs`.
808814 ///
809815 /// This returns NaN when *either* argument is NaN or if a combination of
810816 /// +inf and -inf is provided as arguments.
@@ -821,6 +827,7 @@ impl f128 {
821827 /// # }
822828 /// ```
823829 #[ inline]
830+ #[ doc( alias = "average" ) ]
824831 #[ unstable( feature = "f128" , issue = "116909" ) ]
825832 #[ rustc_const_unstable( feature = "f128" , issue = "116909" ) ]
826833 pub const fn midpoint ( self , other : f128 ) -> f128 {
@@ -903,6 +910,7 @@ impl f128 {
903910 #[ inline]
904911 #[ unstable( feature = "f128" , issue = "116909" ) ]
905912 #[ must_use = "this returns the result of the operation, without modifying the original" ]
913+ #[ cfg_attr( not( bootstrap) , allow( unnecessary_transmutes) ) ]
906914 pub const fn to_bits ( self ) -> u128 {
907915 // SAFETY: `u128` is a plain old datatype so we can always transmute to it.
908916 unsafe { mem:: transmute ( self ) }
@@ -950,6 +958,7 @@ impl f128 {
950958 #[ inline]
951959 #[ must_use]
952960 #[ unstable( feature = "f128" , issue = "116909" ) ]
961+ #[ cfg_attr( not( bootstrap) , allow( unnecessary_transmutes) ) ]
953962 pub const fn from_bits ( v : u128 ) -> Self {
954963 // It turns out the safety issues with sNaN were overblown! Hooray!
955964 // SAFETY: `u128` is a plain old datatype so we can always transmute from it.
@@ -1373,8 +1382,9 @@ impl f128 {
13731382 /// See [algebraic operators](primitive@f32#algebraic-operators) for more info.
13741383 #[ must_use = "method returns a new number and does not mutate the original value" ]
13751384 #[ unstable( feature = "float_algebraic" , issue = "136469" ) ]
1385+ #[ rustc_const_unstable( feature = "float_algebraic" , issue = "136469" ) ]
13761386 #[ inline]
1377- pub fn algebraic_add ( self , rhs : f128 ) -> f128 {
1387+ pub const fn algebraic_add ( self , rhs : f128 ) -> f128 {
13781388 intrinsics:: fadd_algebraic ( self , rhs)
13791389 }
13801390
@@ -1383,8 +1393,9 @@ impl f128 {
13831393 /// See [algebraic operators](primitive@f32#algebraic-operators) for more info.
13841394 #[ must_use = "method returns a new number and does not mutate the original value" ]
13851395 #[ unstable( feature = "float_algebraic" , issue = "136469" ) ]
1396+ #[ rustc_const_unstable( feature = "float_algebraic" , issue = "136469" ) ]
13861397 #[ inline]
1387- pub fn algebraic_sub ( self , rhs : f128 ) -> f128 {
1398+ pub const fn algebraic_sub ( self , rhs : f128 ) -> f128 {
13881399 intrinsics:: fsub_algebraic ( self , rhs)
13891400 }
13901401
@@ -1393,8 +1404,9 @@ impl f128 {
13931404 /// See [algebraic operators](primitive@f32#algebraic-operators) for more info.
13941405 #[ must_use = "method returns a new number and does not mutate the original value" ]
13951406 #[ unstable( feature = "float_algebraic" , issue = "136469" ) ]
1407+ #[ rustc_const_unstable( feature = "float_algebraic" , issue = "136469" ) ]
13961408 #[ inline]
1397- pub fn algebraic_mul ( self , rhs : f128 ) -> f128 {
1409+ pub const fn algebraic_mul ( self , rhs : f128 ) -> f128 {
13981410 intrinsics:: fmul_algebraic ( self , rhs)
13991411 }
14001412
@@ -1403,8 +1415,9 @@ impl f128 {
14031415 /// See [algebraic operators](primitive@f32#algebraic-operators) for more info.
14041416 #[ must_use = "method returns a new number and does not mutate the original value" ]
14051417 #[ unstable( feature = "float_algebraic" , issue = "136469" ) ]
1418+ #[ rustc_const_unstable( feature = "float_algebraic" , issue = "136469" ) ]
14061419 #[ inline]
1407- pub fn algebraic_div ( self , rhs : f128 ) -> f128 {
1420+ pub const fn algebraic_div ( self , rhs : f128 ) -> f128 {
14081421 intrinsics:: fdiv_algebraic ( self , rhs)
14091422 }
14101423
@@ -1413,8 +1426,9 @@ impl f128 {
14131426 /// See [algebraic operators](primitive@f32#algebraic-operators) for more info.
14141427 #[ must_use = "method returns a new number and does not mutate the original value" ]
14151428 #[ unstable( feature = "float_algebraic" , issue = "136469" ) ]
1429+ #[ rustc_const_unstable( feature = "float_algebraic" , issue = "136469" ) ]
14161430 #[ inline]
1417- pub fn algebraic_rem ( self , rhs : f128 ) -> f128 {
1431+ pub const fn algebraic_rem ( self , rhs : f128 ) -> f128 {
14181432 intrinsics:: frem_algebraic ( self , rhs)
14191433 }
14201434}
0 commit comments