@@ -796,8 +796,9 @@ impl f32 {
796796 #[ unstable( feature = "float_next_up_down" , issue = "91399" ) ]
797797 #[ rustc_const_unstable( feature = "float_next_up_down" , issue = "91399" ) ]
798798 pub const fn next_up ( self ) -> Self {
799- // We must use strictly integer arithmetic to prevent denormals from
800- // flushing to zero after an arithmetic operation on some platforms.
799+ // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
800+ // denormals to zero. This is in general unsound and unsupported, but here
801+ // we do our best to still produce the correct result on such targets.
801802 let bits = self . to_bits ( ) ;
802803 if self . is_nan ( ) || bits == Self :: INFINITY . to_bits ( ) {
803804 return self ;
@@ -843,8 +844,9 @@ impl f32 {
843844 #[ unstable( feature = "float_next_up_down" , issue = "91399" ) ]
844845 #[ rustc_const_unstable( feature = "float_next_up_down" , issue = "91399" ) ]
845846 pub const fn next_down ( self ) -> Self {
846- // We must use strictly integer arithmetic to prevent denormals from
847- // flushing to zero after an arithmetic operation on some platforms.
847+ // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
848+ // denormals to zero. This is in general unsound and unsupported, but here
849+ // we do our best to still produce the correct result on such targets.
848850 let bits = self . to_bits ( ) ;
849851 if self . is_nan ( ) || bits == Self :: NEG_INFINITY . to_bits ( ) {
850852 return self ;
0 commit comments