File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
libc/src/__support/FPUtil Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -81,15 +81,21 @@ template <typename T, size_t N> struct ExceptValues {
8181 StorageType out_bits = values[i].rnd_towardzero_result ;
8282 switch (fputil::quick_get_round ()) {
8383 case FE_UPWARD:
84- out_bits += sign ? values[i].rnd_downward_offset
85- : values[i].rnd_upward_offset ;
84+ out_bits += sign ? static_cast <decltype (out_bits)>(
85+ values[i].rnd_downward_offset )
86+ : static_cast <decltype (out_bits)>(
87+ values[i].rnd_upward_offset );
8688 break ;
8789 case FE_DOWNWARD:
88- out_bits += sign ? values[i].rnd_upward_offset
89- : values[i].rnd_downward_offset ;
90+ out_bits +=
91+ sign
92+ ? static_cast <decltype (out_bits)>(values[i].rnd_upward_offset )
93+ : static_cast <decltype (out_bits)>(
94+ values[i].rnd_downward_offset );
9095 break ;
9196 case FE_TONEAREST:
92- out_bits += values[i].rnd_tonearest_offset ;
97+ out_bits +=
98+ static_cast <decltype (out_bits)>(values[i].rnd_tonearest_offset );
9399 break ;
94100 }
95101 T result = FPBits<T>(out_bits).get_val ();
You can’t perform that action at this time.
0 commit comments