File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
src/__support/FPUtil/generic Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ div(InType x, InType y) {
78
78
}
79
79
80
80
if (y_bits.is_inf ())
81
- return OutFPBits::inf (result_sign).get_val ();
81
+ return OutFPBits::zero (result_sign).get_val ();
82
82
83
83
if (y_bits.is_zero ()) {
84
84
if (x_bits.is_zero ()) {
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ class DivTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
47
47
EXPECT_FP_EQ (neg_inf, func (in.neg_inf , in.zero ));
48
48
EXPECT_FP_EQ (neg_inf, func (in.inf , in.neg_zero ));
49
49
EXPECT_FP_EQ (inf, func (in.neg_inf , in.neg_zero ));
50
+ EXPECT_FP_EQ (zero, func (in.min_normal , in.inf ));
51
+ EXPECT_FP_EQ (zero, func (in.zero , in.inf ));
52
+ EXPECT_FP_EQ (zero, func (in.neg_zero , in.neg_inf ));
53
+ EXPECT_FP_EQ (neg_zero, func (in.min_normal , in.neg_inf ));
54
+ EXPECT_FP_EQ (neg_zero, func (in.zero , in.neg_inf ));
50
55
}
51
56
52
57
void test_division_by_zero (DivFunc func) {
You can’t perform that action at this time.
0 commit comments