File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -874,13 +874,13 @@ impl f128 {
874874 // Overflow is impossible
875875 ( a + b) / 2.
876876 } else if abs_a < LO {
877- // Not safe to halve a
877+ // Not safe to halve `a` (would underflow)
878878 a + ( b / 2. )
879879 } else if abs_b < LO {
880- // Not safe to halve b
880+ // Not safe to halve `b` (would underflow)
881881 ( a / 2. ) + b
882882 } else {
883- // Not safe to halve a and b
883+ // Safe to halve `a` and `b`
884884 ( a / 2. ) + ( b / 2. )
885885 }
886886 }
Original file line number Diff line number Diff line change @@ -904,13 +904,13 @@ impl f16 {
904904 // Overflow is impossible
905905 ( a + b) / 2.
906906 } else if abs_a < LO {
907- // Not safe to halve a
907+ // Not safe to halve `a` (would underflow)
908908 a + ( b / 2. )
909909 } else if abs_b < LO {
910- // Not safe to halve b
910+ // Not safe to halve `b` (would underflow)
911911 ( a / 2. ) + b
912912 } else {
913- // Not safe to halve a and b
913+ // Safe to halve `a` and `b`
914914 ( a / 2. ) + ( b / 2. )
915915 }
916916 }
Original file line number Diff line number Diff line change @@ -1066,13 +1066,13 @@ impl f32 {
10661066 // Overflow is impossible
10671067 ( a + b) / 2.
10681068 } else if abs_a < LO {
1069- // Not safe to halve a
1069+ // Not safe to halve `a` (would underflow)
10701070 a + ( b / 2. )
10711071 } else if abs_b < LO {
1072- // Not safe to halve b
1072+ // Not safe to halve `b` (would underflow)
10731073 ( a / 2. ) + b
10741074 } else {
1075- // Not safe to halve a and b
1075+ // Safe to halve `a` and `b`
10761076 ( a / 2. ) + ( b / 2. )
10771077 }
10781078 }
Original file line number Diff line number Diff line change @@ -1060,13 +1060,13 @@ impl f64 {
10601060 // Overflow is impossible
10611061 ( a + b) / 2.
10621062 } else if abs_a < LO {
1063- // Not safe to halve a
1063+ // Not safe to halve `a` (would underflow)
10641064 a + ( b / 2. )
10651065 } else if abs_b < LO {
1066- // Not safe to halve b
1066+ // Not safe to halve `b` (would underflow)
10671067 ( a / 2. ) + b
10681068 } else {
1069- // Not safe to halve a and b
1069+ // Safe to halve `a` and `b`
10701070 ( a / 2. ) + ( b / 2. )
10711071 }
10721072 }
You can’t perform that action at this time.
0 commit comments